产品课程详情

master
yujialong 5 months ago
parent 5d997905c9
commit 23be87ae7f
  1. 8
      src/api/index.js
  2. 1
      src/pages/article/add/index.vue
  3. 81
      src/pages/article/add/product.vue
  4. 2
      src/pages/article/list/index.vue

@ -1,13 +1,13 @@
import Setting from '@/setting'
const { huoranApi, apiBaseURL: host } = Setting
const { apiBaseURL: host } = Setting
export default {
logins: `/iasf/sys/user/login`,
verification: `${host}/iasf/sys/getVerify`,
upload: `${host}/iasf/sysFiles/upload`,
courseDiscipline: `${huoranApi}/nakadai/nakadai/subject/courseDiscipline`,
courseProfessionalClass: `${huoranApi}/nakadai/nakadai/subject/courseProfessionalClass`,
courseProfessional: `${huoranApi}/nakadai/nakadai/subject/courseProfessional`,
courseDiscipline: `/iasf/subject/courseDiscipline`,
courseProfessionalClass: `/iasf/subject/courseProfessionalClass`,
courseProfessional: `/iasf/subject/courseProfessional`,
listByPage: `/iasf/sysFiles/listByPage`,
delFile: `/iasf/sysFiles/delete`,
updateFile: `/iasf/sysFiles/update`,

@ -839,6 +839,7 @@ export default {
data.map(e => {
result.find(n => n.style === e.style) || result.push(e)
})
result.pop() // /add/product
this.detailStyle = result
}).catch(err => { })
},

@ -67,7 +67,7 @@
<el-form-item label="专业">
<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"
:value="item.majorId"></el-option>
:value="item.professionalId"></el-option>
</el-select>
</el-form-item>
<i v-if="i" class="del el-icon-delete" @click="form.subjectSpecialtyList.splice(i, 1)"></i>
@ -305,8 +305,8 @@ export default {
]),
getModelData: {
get () {
const data = this.classifications.find(item => item.id === this.form.classificationTagId)
return data ? data.id : ''
const data = this.classifications.find(item => item.categoryId === this.form.classificationTagId)
return data ? data.categoryId : ''
},
set (newVal) {
this.form.classificationTagId = newVal
@ -368,26 +368,33 @@ export default {
name: this.$route.query.id ? '编辑' : '新增'
}
])
this.form.id ? this.getData() : this.getColumn()
this.form.id && this.getData()
this.getSubject()
this.getClassification()
this.getLabel()
// this.getTemplate()
},
methods: {
//
getData () {
this.$post(`${this.api.productDetailsFind}?id=${this.form.id}`).then(({ data }) => {
data.categoryId = data.categoryId ? data.categoryId.split(',').map(e => +e) : []
if (data.classificationTagId) data.classificationTagId = +data.classificationTagId
this.originalName = data.name
let lableData = []
data.categoryId.forEach(item => {
this.categories.forEach(options => {
if (item == options.id) {
lableData.push(item)
}
})
// let lableData = []
// data.categoryId.forEach(item => {
// this.categories.forEach(options => {
// if (item == options.id) {
// 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
}).catch(err => { })
},
@ -401,7 +408,6 @@ export default {
form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 78
}
this.getClassification()
this.$nextTick(() => {
this.updateTime = 0
})
@ -427,8 +433,8 @@ export default {
},
//
async getSubject () {
const { list } = await this.$get(this.api.courseDiscipline)
this.subjectList = list
const { data } = await this.$get(this.api.courseDiscipline)
this.subjectList = data
this.form.subjectSpecialtyList.forEach(e => {
e.subjectCategoryId === 1 && this.getProfessionalClass(e)
})
@ -444,10 +450,10 @@ export default {
this.getProfessionalClassData(item)
},
async getProfessionalClassData (item) {
const { list } = await this.$get(this.api.courseProfessionalClass, {
const { data } = await this.$get(this.api.courseProfessionalClass, {
disciplineId: item.subjectCategoryId
})
item.professionalClassList = list
this.$set(item, 'professionalClassList', data)
this.form.subjectSpecialtyList.forEach(e => {
e.professionalCategoryId === 1 && this.getProfessional(e)
})
@ -462,33 +468,23 @@ export default {
this.getProfessionalData(item)
},
async getProfessionalData (item) {
const { list } = await this.$get(this.api.courseProfessional, {
const { data } = await this.$get(this.api.courseProfessional, {
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 () {
this.$post(`${this.api.categoryList}?siteId=${this.site.id}&type=0`).then(({ data }) => {
this.classifications = data
}).catch(err => { })
},
//
//
setClass () {
this.classVisible = true
},
//
//
addClass () {
this.classifications.push({
edit: true,
@ -496,11 +492,11 @@ export default {
name: ''
})
},
//
//
editClass (row) {
this.$set(row, 'edit', 1)
},
//
//
delClass (row, i) {
if (row.categoryId) {
this.$confirm('确定要删除吗?', '提示', {
@ -515,7 +511,7 @@ export default {
this.classifications.splice(i, 1)
}
},
//
//
submitClass (row, showMsg = 1) {
if (!row.name) return Util.errorMsg('请输入分类')
// 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
}).catch(err => { })
},
//
//
setLabel () {
this.labelVisible = true
},
//
//
addLabel () {
this.categories.push({
edit: true,
@ -570,11 +566,11 @@ export default {
name: ''
})
},
//
//
editLabel (row) {
this.$set(row, 'edit', 1)
},
//
//
delLabel (row, i) {
if (row.categoryId) {
this.$confirm('确定要删除吗?', '提示', {
@ -589,7 +585,7 @@ export default {
this.categories.splice(i, 1)
}
},
//
//
submitLabel (row, showMsg = 1) {
if (!row.name) return Util.errorMsg('请输入类型')
// 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 => { })
},
//
//
closeLabel () {
const list = this.categories
if (list.find(e => e.edit && e.name)) {
@ -791,7 +787,6 @@ export default {
delete e.professionalClassList
delete e.professionalList
})
form.publishStatus = publishStatus
this.submiting = true
form.editorId = +this.$store.state.user.userId

@ -387,7 +387,7 @@ export default {
if (!this.columns.length) return util.errorMsg('请添加栏目')
const node = this.$refs.column.getCurrentNode()
this.setColumn(node)
this.$router.push(`${this.isCourseProduct ? 'addProduct' : 'add'}?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
this.$router.push(`${node.templateId === 12 || node.listStyleId === 73 ? 'addProduct' : 'add'}?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
},
//
sortChange (column) {

Loading…
Cancel
Save