|
|
@ -67,7 +67,7 @@ |
|
|
|
<el-form-item label="专业"> |
|
|
|
<el-form-item label="专业"> |
|
|
|
<el-select v-model="item.majorId" :disabled="item.professionalCategoryId ? false : true"> |
|
|
|
<el-select v-model="item.majorId" :disabled="item.professionalCategoryId ? false : true"> |
|
|
|
<el-option v-for="(item, i) in item.professionalList" :key="i" :label="item.professionalName" |
|
|
|
<el-option v-for="(item, i) in item.professionalList" :key="i" :label="item.professionalName" |
|
|
|
:value="item.majorId"></el-option> |
|
|
|
:value="item.professionalId"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<i v-if="i" class="del el-icon-delete" @click="form.subjectSpecialtyList.splice(i, 1)"></i> |
|
|
|
<i v-if="i" class="del el-icon-delete" @click="form.subjectSpecialtyList.splice(i, 1)"></i> |
|
|
@ -305,8 +305,8 @@ export default { |
|
|
|
]), |
|
|
|
]), |
|
|
|
getModelData: { |
|
|
|
getModelData: { |
|
|
|
get () { |
|
|
|
get () { |
|
|
|
const data = this.classifications.find(item => item.id === this.form.classificationTagId) |
|
|
|
const data = this.classifications.find(item => item.categoryId === this.form.classificationTagId) |
|
|
|
return data ? data.id : '' |
|
|
|
return data ? data.categoryId : '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
set (newVal) { |
|
|
|
set (newVal) { |
|
|
|
this.form.classificationTagId = newVal |
|
|
|
this.form.classificationTagId = newVal |
|
|
@ -368,26 +368,33 @@ export default { |
|
|
|
name: this.$route.query.id ? '编辑' : '新增' |
|
|
|
name: this.$route.query.id ? '编辑' : '新增' |
|
|
|
} |
|
|
|
} |
|
|
|
]) |
|
|
|
]) |
|
|
|
this.form.id ? this.getData() : this.getColumn() |
|
|
|
this.form.id && this.getData() |
|
|
|
this.getSubject() |
|
|
|
this.getSubject() |
|
|
|
|
|
|
|
this.getClassification() |
|
|
|
this.getLabel() |
|
|
|
this.getLabel() |
|
|
|
// this.getTemplate() |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 获取文章详情 |
|
|
|
// 获取文章详情 |
|
|
|
getData () { |
|
|
|
getData () { |
|
|
|
this.$post(`${this.api.productDetailsFind}?id=${this.form.id}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.productDetailsFind}?id=${this.form.id}`).then(({ data }) => { |
|
|
|
data.categoryId = data.categoryId ? data.categoryId.split(',').map(e => +e) : [] |
|
|
|
data.categoryId = data.categoryId ? data.categoryId.split(',').map(e => +e) : [] |
|
|
|
|
|
|
|
if (data.classificationTagId) data.classificationTagId = +data.classificationTagId |
|
|
|
this.originalName = data.name |
|
|
|
this.originalName = data.name |
|
|
|
let lableData = [] |
|
|
|
// let lableData = [] |
|
|
|
data.categoryId.forEach(item => { |
|
|
|
// data.categoryId.forEach(item => { |
|
|
|
this.categories.forEach(options => { |
|
|
|
// this.categories.forEach(options => { |
|
|
|
if (item == options.id) { |
|
|
|
// if (item == options.id) { |
|
|
|
lableData.push(item) |
|
|
|
// lableData.push(item) |
|
|
|
} |
|
|
|
// } |
|
|
|
}) |
|
|
|
// }) |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// data.categoryId = lableData |
|
|
|
|
|
|
|
this.getColumn() |
|
|
|
|
|
|
|
data.subjectSpecialtyList && data.subjectSpecialtyList.map(e => { |
|
|
|
|
|
|
|
e.subjectCategoryId !== 1 && this.getProfessionalClassData(e) |
|
|
|
|
|
|
|
e.professionalCategoryId !== 1 && this.getProfessionalData(e) |
|
|
|
}) |
|
|
|
}) |
|
|
|
data.categoryId = lableData |
|
|
|
console.log("🚀 ~ this.$post ~ data:", data) |
|
|
|
this.form = data |
|
|
|
this.form = data |
|
|
|
}).catch(err => { }) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -401,7 +408,6 @@ export default { |
|
|
|
form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 78 |
|
|
|
form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 78 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.getClassification() |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.updateTime = 0 |
|
|
|
this.updateTime = 0 |
|
|
|
}) |
|
|
|
}) |
|
|
@ -427,8 +433,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取学科类别 |
|
|
|
// 获取学科类别 |
|
|
|
async getSubject () { |
|
|
|
async getSubject () { |
|
|
|
const { list } = await this.$get(this.api.courseDiscipline) |
|
|
|
const { data } = await this.$get(this.api.courseDiscipline) |
|
|
|
this.subjectList = list |
|
|
|
this.subjectList = data |
|
|
|
this.form.subjectSpecialtyList.forEach(e => { |
|
|
|
this.form.subjectSpecialtyList.forEach(e => { |
|
|
|
e.subjectCategoryId === 1 && this.getProfessionalClass(e) |
|
|
|
e.subjectCategoryId === 1 && this.getProfessionalClass(e) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -444,10 +450,10 @@ export default { |
|
|
|
this.getProfessionalClassData(item) |
|
|
|
this.getProfessionalClassData(item) |
|
|
|
}, |
|
|
|
}, |
|
|
|
async getProfessionalClassData (item) { |
|
|
|
async getProfessionalClassData (item) { |
|
|
|
const { list } = await this.$get(this.api.courseProfessionalClass, { |
|
|
|
const { data } = await this.$get(this.api.courseProfessionalClass, { |
|
|
|
disciplineId: item.subjectCategoryId |
|
|
|
disciplineId: item.subjectCategoryId |
|
|
|
}) |
|
|
|
}) |
|
|
|
item.professionalClassList = list |
|
|
|
this.$set(item, 'professionalClassList', data) |
|
|
|
this.form.subjectSpecialtyList.forEach(e => { |
|
|
|
this.form.subjectSpecialtyList.forEach(e => { |
|
|
|
e.professionalCategoryId === 1 && this.getProfessional(e) |
|
|
|
e.professionalCategoryId === 1 && this.getProfessional(e) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -462,33 +468,23 @@ export default { |
|
|
|
this.getProfessionalData(item) |
|
|
|
this.getProfessionalData(item) |
|
|
|
}, |
|
|
|
}, |
|
|
|
async getProfessionalData (item) { |
|
|
|
async getProfessionalData (item) { |
|
|
|
const { list } = await this.$get(this.api.courseProfessional, { |
|
|
|
const { data } = await this.$get(this.api.courseProfessional, { |
|
|
|
professionalClassId: item.professionalCategoryId |
|
|
|
professionalClassId: item.professionalCategoryId |
|
|
|
}) |
|
|
|
}) |
|
|
|
item.professionalList = list |
|
|
|
this.$set(item, 'professionalList', data) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有模板 |
|
|
|
// 获取分类 |
|
|
|
getTemplate () { |
|
|
|
|
|
|
|
this.$post(this.api.individualTemplateDetailsStyle).then(({ data }) => { |
|
|
|
|
|
|
|
const result = [] |
|
|
|
|
|
|
|
data.map(e => { |
|
|
|
|
|
|
|
result.find(n => n.style === e.style) || result.push(e) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.detailStyle = result |
|
|
|
|
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取所属分类 |
|
|
|
|
|
|
|
getClassification () { |
|
|
|
getClassification () { |
|
|
|
this.$post(`${this.api.categoryList}?siteId=${this.site.id}&type=0`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.categoryList}?siteId=${this.site.id}&type=0`).then(({ data }) => { |
|
|
|
this.classifications = data |
|
|
|
this.classifications = data |
|
|
|
}).catch(err => { }) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 显示所属分类弹框 |
|
|
|
// 显示分类弹框 |
|
|
|
setClass () { |
|
|
|
setClass () { |
|
|
|
this.classVisible = true |
|
|
|
this.classVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增所属分类 |
|
|
|
// 新增分类 |
|
|
|
addClass () { |
|
|
|
addClass () { |
|
|
|
this.classifications.push({ |
|
|
|
this.classifications.push({ |
|
|
|
edit: true, |
|
|
|
edit: true, |
|
|
@ -496,11 +492,11 @@ export default { |
|
|
|
name: '' |
|
|
|
name: '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑所属分类 |
|
|
|
// 编辑分类 |
|
|
|
editClass (row) { |
|
|
|
editClass (row) { |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除所属分类 |
|
|
|
// 删除分类 |
|
|
|
delClass (row, i) { |
|
|
|
delClass (row, i) { |
|
|
|
if (row.categoryId) { |
|
|
|
if (row.categoryId) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
@ -515,7 +511,7 @@ export default { |
|
|
|
this.classifications.splice(i, 1) |
|
|
|
this.classifications.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交所属分类 |
|
|
|
// 提交分类 |
|
|
|
submitClass (row, showMsg = 1) { |
|
|
|
submitClass (row, showMsg = 1) { |
|
|
|
if (!row.name) return Util.errorMsg('请输入分类') |
|
|
|
if (!row.name) return Util.errorMsg('请输入分类') |
|
|
|
// this.$post(`${this.api.checkClassif}?name=${row.name}&siteId=${this.site.id}&classificationTagId=${row.id}`).then(res => { |
|
|
|
// this.$post(`${this.api.checkClassif}?name=${row.name}&siteId=${this.site.id}&classificationTagId=${row.id}`).then(res => { |
|
|
@ -558,11 +554,11 @@ export default { |
|
|
|
this.categories = data |
|
|
|
this.categories = data |
|
|
|
}).catch(err => { }) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 显示标签弹框 |
|
|
|
// 显示类型 |
|
|
|
setLabel () { |
|
|
|
setLabel () { |
|
|
|
this.labelVisible = true |
|
|
|
this.labelVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增标签 |
|
|
|
// 新增类型 |
|
|
|
addLabel () { |
|
|
|
addLabel () { |
|
|
|
this.categories.push({ |
|
|
|
this.categories.push({ |
|
|
|
edit: true, |
|
|
|
edit: true, |
|
|
@ -570,11 +566,11 @@ export default { |
|
|
|
name: '' |
|
|
|
name: '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑标签 |
|
|
|
// 编辑类型 |
|
|
|
editLabel (row) { |
|
|
|
editLabel (row) { |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除标签 |
|
|
|
// 删除类型 |
|
|
|
delLabel (row, i) { |
|
|
|
delLabel (row, i) { |
|
|
|
if (row.categoryId) { |
|
|
|
if (row.categoryId) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
@ -589,7 +585,7 @@ export default { |
|
|
|
this.categories.splice(i, 1) |
|
|
|
this.categories.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交标签 |
|
|
|
// 提交类型 |
|
|
|
submitLabel (row, showMsg = 1) { |
|
|
|
submitLabel (row, showMsg = 1) { |
|
|
|
if (!row.name) return Util.errorMsg('请输入类型') |
|
|
|
if (!row.name) return Util.errorMsg('请输入类型') |
|
|
|
// this.$post(`${this.api.checkLabel}?name=${row.name}&siteId=${this.site.id}&labelId=${row.id}`).then(res => { |
|
|
|
// this.$post(`${this.api.checkLabel}?name=${row.name}&siteId=${this.site.id}&labelId=${row.id}`).then(res => { |
|
|
@ -606,7 +602,7 @@ export default { |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
// }).catch(res => { }) |
|
|
|
// }).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 关闭所属分类 |
|
|
|
// 关闭类型 |
|
|
|
closeLabel () { |
|
|
|
closeLabel () { |
|
|
|
const list = this.categories |
|
|
|
const list = this.categories |
|
|
|
if (list.find(e => e.edit && e.name)) { |
|
|
|
if (list.find(e => e.edit && e.name)) { |
|
|
@ -791,7 +787,6 @@ export default { |
|
|
|
delete e.professionalClassList |
|
|
|
delete e.professionalClassList |
|
|
|
delete e.professionalList |
|
|
|
delete e.professionalList |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
form.publishStatus = publishStatus |
|
|
|
form.publishStatus = publishStatus |
|
|
|
this.submiting = true |
|
|
|
this.submiting = true |
|
|
|
form.editorId = +this.$store.state.user.userId |
|
|
|
form.editorId = +this.$store.state.user.userId |
|
|
|