|
|
|
|
@ -33,18 +33,30 @@
|
|
|
|
|
<el-input placeholder="Please Input" style="width:100%" v-model="form.sort"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:is_visible>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select style="width:100%" v-model="form.is_visible" placeholder="Please Select">
|
|
|
|
|
<el-option v-for="item in visibelList" :key="item.id" :label="item.value" :value="item.id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:is_visible>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select style="width:100%" v-model="form.is_visible" placeholder="Please Select">
|
|
|
|
|
<el-option v-for="item in visibelList" :key="item.id" :label="item.value" :value="item.id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:is_recommend>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Recommend:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select style="width:100%" v-model="form.is_recommend" placeholder="Please Select">
|
|
|
|
|
<el-option v-for="item in visibelList" :key="item.id" :label="item.value" :value="item.id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:size>
|
|
|
|
|
@ -115,6 +127,34 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:icon_id>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Icon:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
|
|
|
|
|
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="iconList" ref="pictureUpload" :auto-upload="true"
|
|
|
|
|
:on-success="handlesuccess" :on-remove="handleRemove">
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:icon_active_id>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Icon Active:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
|
|
|
|
|
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="iconActiveList" ref="pictureUpload" :auto-upload="true"
|
|
|
|
|
:on-success="handlesuccessA" :on-remove="handleRemoveA">
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
@ -129,7 +169,10 @@
|
|
|
|
|
} from "@/api/application/category.js"
|
|
|
|
|
import {
|
|
|
|
|
index as getBaseList
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
import {
|
|
|
|
|
getToken
|
|
|
|
|
} from '@/utils/auth'
|
|
|
|
|
import {
|
|
|
|
|
index
|
|
|
|
|
} from "@/api/product/category.js"
|
|
|
|
|
@ -140,15 +183,21 @@
|
|
|
|
|
id: '',
|
|
|
|
|
type: 'add',
|
|
|
|
|
productPhaseList: [],
|
|
|
|
|
webinarList: [],
|
|
|
|
|
webinarList: [],
|
|
|
|
|
uploadOther: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
action: `${process.env.VUE_APP_UPLOAD_API}`,
|
|
|
|
|
iconList: [], // 存储多选的category id
|
|
|
|
|
iconActiveList: [],
|
|
|
|
|
sampleTypeList: [{
|
|
|
|
|
id: 0,
|
|
|
|
|
value: 'Normal'
|
|
|
|
|
}, {
|
|
|
|
|
id: 1,
|
|
|
|
|
value: 'Special'
|
|
|
|
|
}],
|
|
|
|
|
visibelList:[{
|
|
|
|
|
}],
|
|
|
|
|
visibelList: [{
|
|
|
|
|
id: 1,
|
|
|
|
|
value: 'Yes'
|
|
|
|
|
}, {
|
|
|
|
|
@ -157,14 +206,17 @@
|
|
|
|
|
}],
|
|
|
|
|
form: {
|
|
|
|
|
name: '',
|
|
|
|
|
type: 0,
|
|
|
|
|
is_visible:1,
|
|
|
|
|
type: 0,
|
|
|
|
|
is_visible: 1,
|
|
|
|
|
is_recommend: 0,
|
|
|
|
|
sort: 0,
|
|
|
|
|
size: [],
|
|
|
|
|
lon: [],
|
|
|
|
|
phase: [],
|
|
|
|
|
interaction: [],
|
|
|
|
|
webinar_ids: []
|
|
|
|
|
webinar_ids: [],
|
|
|
|
|
icon_id:'',
|
|
|
|
|
icon_active_id:''
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
name: [{
|
|
|
|
|
@ -200,12 +252,61 @@
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
})
|
|
|
|
|
this.webinarList = res.data
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
|
this.iconList = fileList
|
|
|
|
|
},
|
|
|
|
|
handlesuccess(response, file, fileList) {
|
|
|
|
|
if (response && response.hasOwnProperty('errcode')) {
|
|
|
|
|
this.$Message.warning(response.errmsg || '')
|
|
|
|
|
this.iconList = []
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.iconList = fileList
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleRemoveA(file, fileList) {
|
|
|
|
|
this.iconActiveList = fileList
|
|
|
|
|
},
|
|
|
|
|
handlesuccessA(response, file, fileList) {
|
|
|
|
|
if (response && response.hasOwnProperty('errcode')) {
|
|
|
|
|
this.$Message.warning(response.errmsg || '')
|
|
|
|
|
this.iconList = []
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.iconActiveList = fileList
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
if (this.id) {
|
|
|
|
|
this.form.id = this.id
|
|
|
|
|
} else {
|
|
|
|
|
this.form.id = ''
|
|
|
|
|
}
|
|
|
|
|
if (this.iconList.length > 0) {
|
|
|
|
|
for (var h of this.iconList) {
|
|
|
|
|
if (h.response) {
|
|
|
|
|
this.form.icon_id = h.response.id
|
|
|
|
|
} else {
|
|
|
|
|
this.form.icon_id = h.id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.form.icon_id = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.iconActiveList.length > 0) {
|
|
|
|
|
for (var h of this.iconActiveList) {
|
|
|
|
|
if (h.response) {
|
|
|
|
|
this.form.icon_active_id = h.response.id
|
|
|
|
|
} else {
|
|
|
|
|
this.form.icon_active_id = h.id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.form.icon_active_id = ''
|
|
|
|
|
}
|
|
|
|
|
console.log("this.form", this.form)
|
|
|
|
|
// return
|
|
|
|
|
@ -225,16 +326,34 @@
|
|
|
|
|
getDetail() {
|
|
|
|
|
show({
|
|
|
|
|
id: this.id,
|
|
|
|
|
show_relation: []
|
|
|
|
|
show_relation: ['icon','iconActive']
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.form = this.base.requestToForm(res, this.form)
|
|
|
|
|
this.form.type = res.type ? res.type : 0
|
|
|
|
|
this.form.is_visible = res.is_visible?res.is_visible:0
|
|
|
|
|
this.form.type = res.type ? res.type : 0
|
|
|
|
|
this.form.is_visible = res.is_visible ? res.is_visible : 0
|
|
|
|
|
this.form.is_recommend = res.is_recommend ? res.is_recommend : 0
|
|
|
|
|
|
|
|
|
|
this.form.size = res.size ? res.size : []
|
|
|
|
|
this.form.lon = res.lon ? res.lon : []
|
|
|
|
|
this.form.phase = res.phase ? res.phase : []
|
|
|
|
|
this.form.interaction = res.interaction ? res.interaction : [],
|
|
|
|
|
this.form.webinar_ids = res.webinar_ids ? res.webinar_ids : []
|
|
|
|
|
this.form.interaction = res.interaction ? res.interaction : []
|
|
|
|
|
this.form.webinar_ids = res.webinar_ids ? res.webinar_ids : []
|
|
|
|
|
if(res.icon){
|
|
|
|
|
this.iconList.push({
|
|
|
|
|
name: res.icon.original_name,
|
|
|
|
|
id: res.icon.id,
|
|
|
|
|
url: res.icon.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(res.icon_active){
|
|
|
|
|
this.iconActiveList.push({
|
|
|
|
|
name: res.icon_active.original_name,
|
|
|
|
|
id: res.icon_active.id,
|
|
|
|
|
url: res.icon_active.url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -245,11 +364,14 @@
|
|
|
|
|
this.getDetail()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.iconList = []
|
|
|
|
|
this.iconActiveList = []
|
|
|
|
|
this.form = {
|
|
|
|
|
name: '',
|
|
|
|
|
type: 0,
|
|
|
|
|
is_visible:1,
|
|
|
|
|
type: 0,
|
|
|
|
|
is_visible: 1,
|
|
|
|
|
is_recommend: 0,
|
|
|
|
|
sort: 0,
|
|
|
|
|
size: [],
|
|
|
|
|
lon: [],
|
|
|
|
|
@ -266,4 +388,13 @@
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
::v-deep .is_recommend,
|
|
|
|
|
::v-deep .is_visible,
|
|
|
|
|
::v-deep .sort {
|
|
|
|
|
flex-basis: 33%;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .icon_id,
|
|
|
|
|
::v-deep .icon_active_id{
|
|
|
|
|
flex-basis: 100%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|