Commit 8e8e832c authored by Your Name's avatar Your Name

学习项目和学习内容改动

parent 53f8b625
......@@ -45,6 +45,32 @@ Vue.use(ElementUI);
Vue.use(Vuex);
Vue.config.productionTip = false
Vue.directive("defaultSelect", {
componentUpdated (el, bindings) {
const [defaultValues] = bindings.value
const dealStyle = function (tags) {
// 因为不可删除原有值,所以原有值的index是不会变的,也就是将前n个tag的close隐藏掉即可。n即已有值的长度defaultValues.length
tags.forEach((el, index) => {
if (index<=defaultValues.length-1 && ![...el.classList].includes('select-tag-close-none')) {
el.classList.add('none')
}
})
}
// 设置样式 隐藏close icon
const tags = el.querySelectorAll('.el-tag__close')
if (tags.length === 0) {
// 初始化tags为空处理
setTimeout(() => {
const tagTemp = el.querySelectorAll('.el-tag__close')
dealStyle(tagTemp)
})
} else {
dealStyle(tags)
}
}
});
/* eslint-disable no-new */
new Vue({
el: '#app',
......
......@@ -24,17 +24,18 @@
<script>
export default {
props:{
fileList:{
type:Array,
default:[]
},
},
// props:{
// fileList:{
// type: Array,
// default: () => [],
// },
// },
data() {
return {
fileList: [],
dialogImageUrl: "",
dialogVisible: false,
imageUrl:""
imageUrl:"",
};
},
computed: {
......
......@@ -311,7 +311,7 @@ export default {
// 新增
submitForm(formName) {
console.log(this.ruleForm)
// console.log(this.ruleForm)
this.$refs[formName].validate(valid => {
if (valid) {
this.$https(
......@@ -343,7 +343,7 @@ export default {
delete params.audioList
delete params.imageList
delete params.qrcodeList
console.log(params)
// console.log(params)
this.$https(
{
url: "exhibitionBoard/update",
......
......@@ -29,7 +29,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="所属学习项目" class="w50" prop="learningProjectId">
<el-select placeholder="请选所属学习项目" v-model="ruleForm.learningProjectId">
<el-select placeholder="请选所属学习项目" v-model="ruleForm.learningProjectId" @change="getSelect(ruleForm.learningProjectId)">
<el-option
v-for="item in learningProjectIdList"
:label="item.name"
......@@ -220,6 +220,7 @@ export default {
name: "", //学习内容名称
applicableScope: "ALL_PLAT", //适用范围
cover: "", //宣传图
projectId: '',
learningProjectId: "", //所属学习项目
exhibitionBoardCatIdList: [], //展板类别
copyrightOwnerIdList: [], //版权方
......@@ -291,16 +292,15 @@ export default {
closeDialog() {
this.dialogVisible = false;
},
init() {
this.getLearnProject();
// this.getAssetTypeData();
this.getAssetTypeData2();
async init() {
if (this.$route.query.type === "Update") {
this.getInfo(this.$route.query.id);
await this.getInfo(this.$route.query.id);
}
await this.getLearnProject();
// this.getAssetTypeData();
},
// 获取版权方详情
getInfo(id) {
async getInfo(id) {
let vm = this;
vm.$https({
url: "learningContent/get/" + id,
......@@ -310,6 +310,7 @@ export default {
.then(res => {
let data = res.data.data;
this.ruleForm = data;
// console.log(11111,this.ruleForm.learningProjectId)
this.ruleForm = {
name: data.name,
applicableScope: data.applicableScope,
......@@ -318,13 +319,14 @@ export default {
learningProjectId: data.learningProjectId,
exhibitionBoardCatIdList: data.exhibitionBoardCatIdList,
id: data.id,
exhibitionBoardIdList: data.exhibitionBoardIdList
exhibitionBoardIdList: data.exhibitionBoardIdList,
};
// this.tableData = data.exhibitionBoardList;
this.multipleSelection = data.exhibitionBoardList;
this.$refs.uploadImg.showImg(this.ruleForm.cover);
this.getExhibitionBoardTable();
this.getAssetTypeData()
this.getAssetTypeData2();
})
.catch(function(err) {
console.log(err);
......@@ -357,10 +359,10 @@ export default {
let vm = this;
if(this.ruleForm.copyrightOwnerIdList.length>0){
vm.$https({
url: "exhibitionBoardCat/getList",
url: "exhibitionBoardCat/getListByProjectAndCopyright",
method: "post",
authType: this.backToken
},this.$qs.stringify({copyrightOwnerId:this.ruleForm.copyrightOwnerIdList.toString()}))
},this.$qs.stringify({copyrightIds:this.ruleForm.copyrightOwnerIdList.toString(),learningProjectId:this.ruleForm.learningProjectId}))
.then(res => {
let data = res.data.data;
vm.videoContentCat = data;
......@@ -373,20 +375,24 @@ export default {
}
},
getSelect() {
this.getAssetTypeData2()
},
// 获取版权方列表
getAssetTypeData2() {
let vm = this;
// console.log(this.ruleForm)
vm.$https(
{
url: "copyrightOwner/getList",
url: "copyrightOwner/getListByLearningProjectId",
method: "get",
authType: this.backToken
},
{ copyrightOwnerType: "EXHIBITION_BOARD" }
{ copyrightOwnerType: "EXHIBITION_BOARD",learningProjectId: vm.ruleForm.learningProjectId}
)
.then(res => {
let data = res.data.data;
console.log(data,"dhwdhwid")
// console.log(data,"dhwdhwid")
vm.assetType2 = data;
})
.catch(function(err) {
......@@ -422,7 +428,7 @@ export default {
)
.then(res => {
let data = res.data.data;
console.log(data);
// console.log(data);
})
.catch(function(err) {
console.log(err);
......@@ -439,7 +445,7 @@ export default {
// 新增
submitForm(formName) {
this.$refs[formName].validate(valid => {
console.log(this.ruleForm);
// console.log(this.ruleForm);
if (valid) {
this.$https(
{
......@@ -535,7 +541,8 @@ export default {
// debugger
const param = {
boardCopyrightOwnerIdList: this.ruleForm.copyrightOwnerIdList.toString(),
exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList.toString()
exhibitionBoardCatIdList: this.ruleForm.exhibitionBoardCatIdList.toString(),
learningProjectId:this.ruleForm.learningProjectId
};
if((param.boardCopyrightOwnerIdList.length>0)&&(param.exhibitionBoardCatIdList.length>0)){
this.getTableData(param);
......@@ -549,7 +556,7 @@ export default {
let vm = this;
vm.$https(
{
url: "exhibitionBoard/getList",
url: "exhibitionBoard/getListByLearningId",
method: "post",
authType: this.backToken
},
......
......@@ -181,7 +181,7 @@ export default {
.then(res => {
let data = res.data.data;
this.ruleForm = data;
console.log(this.ruleForm)
// console.log(this.ruleForm)
// this.ruleForm = {
// name :data.name,
// applicableScope:data.applicableScope,
......
This diff is collapsed.
......@@ -249,10 +249,10 @@ export default {
},
// 添加
addPermis() {
// this.$router.push({ path: "videoContentAdd", query: { type: "add" } });
$(".el-dialog__title").html("新建");
this.FormVisible1 = true;
this.type = true;
this.$router.push({ path: "learnProjectAdd", query: { type: "add" } });
// $(".el-dialog__title").html("新建");
// this.FormVisible1 = true;
// this.type = true;
},
handleSubmit(type) {
let httpUrl, httpMethod,requestParams;
......@@ -320,11 +320,15 @@ export default {
},
// 编辑弹框
openEdit(row) {
this.type = false;
$(".el-dialog__title").html("编辑");
let _this = this;
_this.FormVisible1 = true;
this.getAssetTypeInfo(row.id);
this.$router.push({
path: "learnProjectUpdate",
query: { type: "Update", id: row.id },
});
// this.type = false;
// $(".el-dialog__title").html("编辑");
// let _this = this;
// _this.FormVisible1 = true;
// this.getAssetTypeInfo(row.id);
},
// 获取视频分类详情
getAssetTypeInfo(id) {
......
......@@ -178,6 +178,24 @@ export let learnRoute = [
title: '新建学习内容',
}
},
{
path: '/learnProjectAdd',
name: '新建学习项目',
component: () => import('@/page/content/learn/project/add'),
meta: {
showBreadcrumb: true,
title: '新建学习项目',
}
},
{
path: '/learnProjectUpdate',
name: '修改学习项目',
component: () => import('@/page/content/learn/project/add'),
meta: {
showBreadcrumb: true,
title: '修改学习项目',
}
},
{
path: '/learnContentUpdate',
name: '修改学习内容',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment