chore: add shafafiat page
This commit is contained in:
@@ -196,6 +196,13 @@
|
||||
</CCol>
|
||||
</CRow>
|
||||
</CCol>
|
||||
<CCol lg="6">
|
||||
<h4>افزودن آیکون شفافیت:</h4>
|
||||
<el-divider></el-divider>
|
||||
<img :src="page.icon" alt="" style="width: 100%;">
|
||||
<input type="file" ref="icon" @change="iconPreview">
|
||||
<el-divider></el-divider>
|
||||
</CCol>
|
||||
<CCol lg="6">
|
||||
<h4>مشخصات مدیر صفحه:</h4>
|
||||
<el-divider></el-divider>
|
||||
@@ -380,6 +387,9 @@ export default {
|
||||
imagePreview(e) {
|
||||
this.page.managerCover = URL.createObjectURL(e.target.files[0])
|
||||
},
|
||||
iconPreview(e) {
|
||||
this.page.icon = URL.createObjectURL(e.target.files[0])
|
||||
},
|
||||
post() {
|
||||
this.validation = {}
|
||||
const data = new FormData()
|
||||
@@ -412,6 +422,7 @@ export default {
|
||||
data.append("managerName", this.page.managerName)
|
||||
data.append("managerDescription", this.page.managerDescription)
|
||||
if (this.$refs.managerCover.files[0]) data.append("managerCover", this.$refs.managerCover.files[0])
|
||||
if (this.$refs.icon.files[0]) data.append("icon", this.$refs.icon.files[0])
|
||||
|
||||
this.$axios.post(`/api/admin/category`, data, this.axiosConfig)
|
||||
.then(response => {
|
||||
@@ -485,6 +496,8 @@ export default {
|
||||
data.append("managerName", this.page.managerName)
|
||||
data.append("managerDescription", this.page.managerDescription)
|
||||
if (this.$refs.managerCover.files[0]) data.append("managerCover", this.$refs.managerCover.files[0])
|
||||
if (this.$refs.icon.files[0]) data.append("icon", this.$refs.icon.files[0])
|
||||
|
||||
|
||||
this.$axios.put(`/api/admin/category/${this.page._id}`, data, this.axiosConfig)
|
||||
.then(response => {
|
||||
@@ -679,6 +692,7 @@ export default {
|
||||
hasManagerInfo: false,
|
||||
managerName: '',
|
||||
managerDescription: '',
|
||||
icon: '',
|
||||
managerCover: ''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user