目录可多选

This commit is contained in:
@fawn-nine
2024-09-24 15:23:12 +08:00
parent 3dd21d6cde
commit c13d33d0d2

View File

@@ -169,20 +169,26 @@
<!-- <el-input v-model="youForm.key" placeholder="" clearable></el-input> --> <!-- <el-input v-model="youForm.key" placeholder="" clearable></el-input> -->
</el-form-item> </el-form-item>
</div> </div>
<div v-if="youForm.cate.length > 0" style="margin-left:20px"> <!-- {{youForm.cate}} -->
<div v-if="youForm.cate && youForm.cate.length > 0" style="margin-left:20px">
<el-form-item <el-form-item
label="请选择开通的分部:" label="请选择开通的分部:"
label-width="150px" label-width="150px"
prop="catalogueId" prop="catalogueId"
> >
<div v-for="(item, index) in youForm.cate" style="" <div>
<el-checkbox-group v-model="linshiids">
<el-checkbox :label="item.id" v-for="(item, index) in youForm.cate" :key="index">{{item.title}}</el-checkbox>
</el-checkbox-group>
</div>
<!-- <div v-for="(item, index) in youForm.cate" style=""
:key="index"> :key="index">
<el-radio <el-radio
v-model="youForm.catalogueId" v-model="youForm.catalogueId"
:label="item.id" :label="item.id"
>{{ item.title }}</el-radio >{{ item.title }}</el-radio
> >
</div> </div> -->
</el-form-item> </el-form-item>
</div> </div>
@@ -220,6 +226,7 @@ export default {
key: "", key: "",
expire: "", expire: "",
userInfo: "" userInfo: ""
}, },
statusOptions: [ statusOptions: [
{ {
@@ -297,15 +304,25 @@ export default {
dataListSelections: [], dataListSelections: [],
youVisible: false, youVisible: false,
linshiids:[],
youForm: { youForm: {
courseId: null, courseId: null,
cate: [], cate: [],
catalogueId: null, catalogueId: '',
days: "", days: "",
come:"" //管理员开通(原因) come:"" //管理员开通(原因)
} } ,
linshilist:[{
title:'1'
},
{
title:'2',
},
{ title:'3'}
],
}; };
}, },
components: { components: {
@@ -346,7 +363,7 @@ export default {
method: "post", method: "post",
data: this.$http.adornData(data) data: this.$http.adornData(data)
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code == 0) {
this.$message.success('操作成功!') this.$message.success('操作成功!')
this.getDataList() this.getDataList()
} else { } else {
@@ -385,6 +402,7 @@ export default {
}, },
submit() { submit() {
console.log(this.youForm, "youForm"); console.log(this.youForm, "youForm");
this.youForm.catalogueId = this.linshiids.join(',')
this.$refs['youForm'].validate(valid => { this.$refs['youForm'].validate(valid => {
if (valid) { if (valid) {
let data = { let data = {
@@ -399,6 +417,7 @@ export default {
data: this.$http.adornData(data) data: this.$http.adornData(data)
}) })
.then(({ data }) => { .then(({ data }) => {
if(data.code!== 0) return this.$message.error(data.msg)
this.$message.success('开课成功!') this.$message.success('开课成功!')
this.getDataList() this.getDataList()
this.dialogClose() this.dialogClose()
@@ -411,20 +430,18 @@ export default {
}, },
dialogClose() { dialogClose() {
this.youVisible = false; this.youVisible = false;
this.linshiids = []
this.$nextTick(() => { this.$nextTick(() => {
this.youForm.cate = []; this.youForm.cate = [];
this.options = []; this.options = [];
this.$refs["youForm"].resetFields(); this.$refs["youForm"].resetFields();
console.log(this.youForm, "youForm"); console.log(this.youForm, "youForm");
}); });
console.log(this.youForm, "youForm"); console.log(this.youForm, "youForm");
}, },
selectChange(val) { selectChange(val) {
// console.log('val',val) console.log("options", this.options);
console.log("options", this.options);
// const _obj = this.options.find(item => item.id == val);
// this.youForm.cate = _obj.courseCatalogueEntityList;
// console.log(this.youForm.cate, "this.youForm.cate");
this.getCate(val) this.getCate(val)
}, },
remoteMethod(query) { remoteMethod(query) {
@@ -444,13 +461,14 @@ export default {
url: this.$http.adornUrl("/master/userManage/courseAndChildrenList"), url: this.$http.adornUrl("/master/userManage/courseAndChildrenList"),
method: "post", method: "post",
data: this.$http.adornData(data) data: this.$http.adornData(data)
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.options = data.list; this.options = data.list;
} else { } else {
this.options = []; this.options = [];
} }
this.totalLaoding = false; this.totalLaoding = false;
if(data.code !== 0) return this.$message.error(data.msg)
}); });
} else { } else {
this.options = []; this.options = [];
@@ -458,6 +476,8 @@ export default {
} }
}, },
showAddD() { showAddD() {
this.linshiids = []
this.youVisible = true; this.youVisible = true;
}, },
@@ -472,17 +492,10 @@ export default {
method: "get", method: "get",
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if(data && data.code!== 0) return this.$message.error(data.msg)
this.user = data.user; this.user = data.user;
this.getDataList(); this.getDataList();
// if (data.user.avatar && data.user.avatar != "") {
// var img = {
// name: '',
// url: data.user.avatar
// }
// }
}
}); });
}, },
// 获取数据列表 // 获取数据列表
@@ -495,20 +508,21 @@ export default {
data: this.$http.adornData({ data: this.$http.adornData({
"current": this.pageIndex, "current": this.pageIndex,
"limit": this.pageSize, "limit": this.pageSize,
"userInfo": this.userId,//姓名 电话 邮箱 "userInfo": '',//姓名 电话 邮箱
"userId": this.userId,//用户id
"courseName": this.dataForm.key,//课程名 "courseName": this.dataForm.key,//课程名
"come":"", //开课来源 "come":"", //开课来源
"expire": this.dataForm.expire//状态 0有效 -1 过期 "expire": this.dataForm.expire//状态 0有效 -1 过期
}) })
}) })
.then(({ data }) => { .then(({ data }) => {
if (data && data.code === 0) { if(data && data.code!== 0) return this.$message.error(data.msg)
console.log(data,'data') console.log(data,'data')
this.dataList = data.result.records; this.dataList = data.result.records;
this.totalPage = data.result.pages; this.totalPage = data.result.pages;
this.total = data.result.total; this.total = data.result.total;
this.dataListLoading = false; this.dataListLoading = false;
}
}); });
}, },
@@ -534,6 +548,8 @@ export default {
// this.pointForm.pointType == 0 // this.pointForm.pointType == 0
}, },
getCate(id) { getCate(id) {
this.linshiids = []
this.$http({ this.$http({
url: this.$http.adornUrl("/master/userManage/catalogueListByCourse"), url: this.$http.adornUrl("/master/userManage/catalogueListByCourse"),
method: "post", method: "post",
@@ -547,6 +563,8 @@ export default {
// this.youForm.cate // this.youForm.cate
}else{ }else{
this.youForm.cate = [] this.youForm.cate = []
this.linshiids = []
} }
}).catch(e => { }).catch(e => {
console.log('数据报错') console.log('数据报错')