transfer project in github
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div>
|
||||
<CustomSubHeader>
|
||||
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
|
||||
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-contact-us-messages'}">برگشت به صفحه قبل</CButton>
|
||||
</CustomSubHeader>
|
||||
<CCard>
|
||||
<CCardHeader>
|
||||
<slot name="header">
|
||||
<!-- <i class="fal fa-bars"></i>-->
|
||||
<!-- <span>{{ list_title }}</span>-->
|
||||
</slot>
|
||||
</CCardHeader>
|
||||
<CCardBody>
|
||||
<CRow>
|
||||
<CCol md="6">
|
||||
<CForm class="message">
|
||||
<CRow>
|
||||
<CCol sm="12">
|
||||
<CInput
|
||||
label="نام"
|
||||
:value="message.name"
|
||||
disabled
|
||||
/>
|
||||
<CInput
|
||||
label="شماره تماس"
|
||||
:value="message.phone"
|
||||
disabled
|
||||
/>
|
||||
<CInput
|
||||
label="ایمیل"
|
||||
:value="message.email"
|
||||
disabled
|
||||
/>
|
||||
<CTextarea
|
||||
label="پیام"
|
||||
disabled=""
|
||||
:value="message.message"
|
||||
rows="10"
|
||||
/>
|
||||
<p class="form-err" v-if="validation.caption">{{ validation.caption.msg }}</p>
|
||||
</CCol>
|
||||
</CRow>
|
||||
</CForm>
|
||||
</CCol>
|
||||
</CRow>
|
||||
</CCardBody>
|
||||
</CCard>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: 'مشاهده پیام',
|
||||
message: null,
|
||||
validation: {}
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
head() {
|
||||
return {
|
||||
title: this.title
|
||||
}
|
||||
},
|
||||
layout: 'admin',
|
||||
async asyncData({$axios, params, error}) {
|
||||
try {
|
||||
const message = await $axios.get(`/api/admin/contactUsMessages/${params.message}`)
|
||||
return {
|
||||
message: message.data
|
||||
}
|
||||
} catch (e) {
|
||||
if (e?.response?.status === 401) {
|
||||
error({
|
||||
status: 401,
|
||||
message: "لطفا دوباره وارد سیستم شوید.",
|
||||
});
|
||||
}
|
||||
if (e?.response?.status === 403) {
|
||||
error({
|
||||
status: 403,
|
||||
message: e?.response?.data?.message,
|
||||
});
|
||||
}
|
||||
if (e?.response?.status === 500) {
|
||||
error({
|
||||
status: 500,
|
||||
message: "مشکلی در گرفتن اطلاعات پیش آمده",
|
||||
});
|
||||
} else
|
||||
error({
|
||||
status: 404,
|
||||
message: "اطلاعات مورد نظر پیدا نشد",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.message {
|
||||
input:disabled, textarea:disabled {
|
||||
color: #000 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div>
|
||||
<CustomSubHeader>
|
||||
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
|
||||
</CustomSubHeader>
|
||||
|
||||
<CCard>
|
||||
<CCardHeader>
|
||||
<slot name="header">
|
||||
<i class="fal fa-bars"></i>
|
||||
<span>{{ list_title }}</span>
|
||||
</slot>
|
||||
</CCardHeader>
|
||||
<CCardBody>
|
||||
<el-table
|
||||
:data="messages.docs"
|
||||
style="width: 100%"
|
||||
:row-class-name="readStatus">
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="#">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="نام"
|
||||
width="">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="email"
|
||||
label="ایمیل"
|
||||
width="">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="phone"
|
||||
label="شماره تماس"
|
||||
width=""
|
||||
class-name="phoneNumber">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="مشاهده"
|
||||
width="80"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-contact-us-messages-message',params: {message: scope.row._id}}">
|
||||
<i class="far fa-eye"></i>
|
||||
</CButton>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</CCardBody>
|
||||
</CCard>
|
||||
<CCard class="col" v-if="messages.totalDocs>20">
|
||||
<CRow alignHorizontal="center" style="padding : 10px">
|
||||
<el-pagination :hide-on-single-page="true" layout="prev, pager, next" :page-size="messages.limit"
|
||||
@current-change="handleCurrentChange" :current-page.sync="messages.page" :total="messages.totalDocs">
|
||||
</el-pagination>
|
||||
</CRow>
|
||||
</CCard>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: 'لیست اسلایدهای صفحه اصلی',
|
||||
list_title: 'لیست',
|
||||
messages: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pageQuery() {
|
||||
return this.$route.query.page;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pageQuery(newPage, oldPage) {
|
||||
this.$nuxt.refresh();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(page) {
|
||||
// if (!_.isEmpty(this.search)) {
|
||||
// this.handleSearch(page);
|
||||
// } else {
|
||||
this.$router.push({
|
||||
name: "admin-contact-us-messages",
|
||||
query: {
|
||||
page: page
|
||||
}
|
||||
});
|
||||
// }
|
||||
},
|
||||
readStatus({row, rowIndex}) {
|
||||
return row.read ? null : 'unread'
|
||||
}
|
||||
},
|
||||
head() {
|
||||
return {
|
||||
title: this.title
|
||||
}
|
||||
},
|
||||
layout: 'admin',
|
||||
async asyncData({$axios, query, error}) {
|
||||
try {
|
||||
const messages = await $axios.get(`/api/admin/contactUsMessages?page=${query.page || 1}`)
|
||||
return {
|
||||
messages: messages.data
|
||||
}
|
||||
} catch (e) {
|
||||
if (e?.response?.status === 401) {
|
||||
error({
|
||||
status: 401,
|
||||
message: 'شما اجازه دسترسی به این صفحه را ندارید لطفا دوباره وارد شوید'
|
||||
})
|
||||
} else {
|
||||
error({
|
||||
status: 500,
|
||||
message: "مشکلی در گرفتن اطلاعات بوجود آمده است",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.phoneNumber {
|
||||
div {
|
||||
direction: ltr;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.unread {
|
||||
background: rgba(255, 173, 0, 0.12) !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user