feat: add ci cd files dont edit those files
This commit is contained in:
@@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<div class="election-page">
|
||||
|
||||
<div class="container" v-if="!loggedIn">
|
||||
<div class="row login-row">
|
||||
<div class="col-12 col-md-8">
|
||||
<div class="view-form">
|
||||
<img src="~/static/img/logo-re3-150x150.png" alt="">
|
||||
<form @submit.prevent="post">
|
||||
<h2 class="title">ورود</h2>
|
||||
|
||||
<div class="formRow" :class="validation.username ? 'err' : null">
|
||||
<input class="input" v-model="loginData.username" name="userName" type="text" placeholder="ایمیل یا نام کاربری را وارد کنید"/>
|
||||
<p v-if="validation.username">{{ validation.username.msg }}</p>
|
||||
</div>
|
||||
<div class="formRow" :class="validation.password ? 'err' : null">
|
||||
<input class="input" v-model="loginData.password" name="password" type="password" placeholder="پسوورد خود را وارد کنید"/>
|
||||
<p v-if="validation.password">{{ validation.password.msg }}</p>
|
||||
</div>
|
||||
<div class="btnSub">
|
||||
<button class="btn btn-primary btn-link" type="submit">ورود</button>
|
||||
<!-- <nuxt-link >SUBMIT NOW</nuxt-link> -->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" v-else>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<LineTxt label="انتخابات"/>
|
||||
</div>
|
||||
<div class="col-12 stretch">
|
||||
<div class="election-view-item">
|
||||
<div class="election-item1">
|
||||
<h2>{{ election.title }} :</h2>
|
||||
<p class="about-title">درباره انتخابات :</p>
|
||||
<p class="about-txt">{{ election.description }}</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row election-item2">
|
||||
<div class="col-12 col-md-6 col-lg-4 col-xl-3" v-for="item in election.candidates">
|
||||
<div class="election-user" :class="[selectedCandide === item._id ? 'selected' : 'exclude',selectedCandide && 'clicked']">
|
||||
<img :src="item.profilePic" :alt="item.firstName + ' ' + item.lastName">
|
||||
<h3 class="user-name">{{ item.firstName + ' ' + item.lastName }}</h3>
|
||||
<div class="view-btn">
|
||||
<button type="button" @click="itemDialog(item)" class="btn bigBtn btn-primary p-2">مشاهده رزومه</button>
|
||||
<button class="btn bigBtn p-2" :class="selectedCandide === item._id ? 'selectBTN' : 'btn-success'" @click="selectedCandide = item._id">انتخاب</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!------------------------ CV modal ------------------------>
|
||||
<el-dialog :visible.sync="showAlert">
|
||||
<div class="container">
|
||||
<div class="row align-items-center mb-3">
|
||||
<div class="col-12 col-md-4">
|
||||
<img class="img-alert" :src="dialogData.profilePic" :alt="dialogData.firstName + ' ' + dialogData.lastName">
|
||||
</div>
|
||||
<div class="col-12 col-md-8">
|
||||
<h2 class="user-name">{{ dialogData.firstName + ' ' + dialogData.lastName }}</h2>
|
||||
<p>تاریخ تولد : {{ dialogData.bornDate }}</p>
|
||||
<p>کد ملی : {{ dialogData.nationalCode }}</p>
|
||||
<p>مدرک تحصیلی : {{ dialogData.education }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="about"> رزومه :</h3>
|
||||
<p>{{ dialogData.resume }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button class="btn bigBtn btn-primary" @click="showAlert = false">بستن</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!------------------------ CV modal ------------------------>
|
||||
|
||||
<div class="col-12">
|
||||
<button class="btn bigBtn btn-primary pt-2 pb-2 voteBtn" :disabled="!selectedCandide" @click="vote">ثبت رای</button>
|
||||
<button class="btn bigBtn btn-primary pt-2 pb-2" @click="logOutOfElection">خروج</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="not-found" v-if="!election">
|
||||
<p>موردی وجود ندارد!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showAlert: false,
|
||||
loginData: {
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
validation: {},
|
||||
election: null,
|
||||
selectedCandide: '',
|
||||
dialogData: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
loggedIn() {
|
||||
return (this.$auth.loggedIn && this.$auth.hasScope('voter'))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
post() {
|
||||
this.validation = {}
|
||||
this.$auth.loginWith('vote', {
|
||||
data: this.loginData
|
||||
})
|
||||
.then(res => {
|
||||
this.loginData = {
|
||||
username: '',
|
||||
password: '',
|
||||
}
|
||||
this.$nuxt.refresh()
|
||||
})
|
||||
.catch(e => {
|
||||
if (e.response.status === 422) this.validation = e.response.data.validation
|
||||
else console.log(e)
|
||||
})
|
||||
},
|
||||
itemDialog(item) {
|
||||
this.showAlert = !this.showAlert
|
||||
this.dialogData = item
|
||||
},
|
||||
vote() {
|
||||
if (!this.selectedCandide.length) return this.$message({
|
||||
type: 'warning',
|
||||
message: 'ابتدا یک گزینه انتخاب کنید'
|
||||
})
|
||||
this.$confirm("از انتخاب خود اطمینان دارید؟", "هشدار", {
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "لغو",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post('/api/public/addVote', {
|
||||
electionId: this.election._id,
|
||||
candidateId: this.selectedCandide
|
||||
})
|
||||
.then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: 'انتخاب شما با موفقیت ثبت شد'
|
||||
})
|
||||
this.$auth.logout()
|
||||
})
|
||||
.catch(e => {
|
||||
this.error({
|
||||
status: 500, message: 'مشکلی در ارسال اطلاعات به وجود آمده است'
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "عملیات لغو شد",
|
||||
});
|
||||
})
|
||||
},
|
||||
logOutOfElection() {
|
||||
this.$confirm("از صفحه انتخابات خارج میشوید؟", "هشدار", {
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "لغو",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$auth.logout()
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "عملیات لغو شد",
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
async asyncData({$axios, error, $auth}) {
|
||||
try {
|
||||
if ($auth.loggedIn && $auth.hasScope('voter')) {
|
||||
const election = await $axios.get('/api/public/getElection')
|
||||
return {
|
||||
election: election.data,
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
election: []
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
error({
|
||||
status: 401, message: 'شما اجازه دسترسی به این صفحه را ندارید'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="services-page">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<LineTxt label="میز خدمت"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 services-view">
|
||||
<nuxt-link :to="{name: 'portal-services-election', params: {portal: currentPortal}}" class="services-item">
|
||||
<i class="far fa-check-square"></i>
|
||||
<span>شرکت در انتخابات استانداری مرکزی</span>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 services-view">
|
||||
<nuxt-link :to="{name: 'portal-services-meeting', params: {portal: currentPortal}}" class="services-item">
|
||||
<i class="far fa-check-square"></i>
|
||||
<span>ارتباط با استاندار</span>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
computed: {
|
||||
currentPortal() {
|
||||
return this.$route.params.portal
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<div class="meeting-page">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<LineTxt label="ارتباط با استاندار"/>
|
||||
</div>
|
||||
<div class="col-12 ">
|
||||
<div class="view-form">
|
||||
<form @submit.prevent="post">
|
||||
<div class="formRow" :class="validation.name ? 'err' : null">
|
||||
<input class="input" v-model="message.name" name="name" type="text" placeholder="نام و نام خانوادگی خود را وارد کنید"/>
|
||||
<p v-if="validation.name">{{ validation.name.msg }}</p>
|
||||
</div>
|
||||
<div class="formRow" :class="validation.subject ? 'err' : null">
|
||||
<input class="input" v-model="message.subject" name="subject" type="text" placeholder="موضوع خود را وارد کنید"/>
|
||||
<p v-if="validation.subject">{{ validation.subject.msg }}</p>
|
||||
</div>
|
||||
<div class="formRow" :class="validation.description ? 'err' : null">
|
||||
<input class="input" v-model="message.description" name="description" type="text" placeholder="توضیحات خود را وارد کنید"/>
|
||||
<p v-if="validation.description">{{ validation.description.msg }}</p>
|
||||
</div>
|
||||
<div class="formRow" :class="validation.email ? 'err' : null">
|
||||
<input class="input" v-model="message.email" name="email" type="email" placeholder="ایمیل خود را وارد کنید"/>
|
||||
<p v-if="validation.email">{{ validation.email.msg }}</p>
|
||||
</div>
|
||||
<div class="formRow" :class="validation.phoneNumber ? 'err' : null">
|
||||
<input class="input" v-model="message.phoneNumber" name="phoneNumber" type="text" placeholder="شماره تماس خود را وارد کنید"/>
|
||||
<p v-if="validation.phoneNumber">{{ validation.phoneNumber.msg }}</p>
|
||||
</div>
|
||||
|
||||
<div class="formRow" :class="validation.nationalCode ? 'err' : null">
|
||||
<input class="input" v-model="message.nationalCode" name="nationalCode" type="text" placeholder="کدملی خود را وارد کنید"/>
|
||||
<p v-if="validation.nationalCode">{{ validation.nationalCode.msg }}</p>
|
||||
</div>
|
||||
|
||||
<div class="row view-captcha">
|
||||
<div class="formRow col-12 col-md-6" :class="validation.captcha ? 'err' : null">
|
||||
<input v-model="message.captcha" class="input" name="captcha" type="text" placeholder="متن داخل عکس را وارد کنید"/>
|
||||
</div>
|
||||
<div class="new-captcha col-12 col-md-6">
|
||||
<div class="captcha" v-html="captcha"></div>
|
||||
<button @click="reloadCaptcha" type="button" class="btn btn-primary">
|
||||
<i class="fas fa-sync-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="err-captcha" v-if="validation.captcha">{{ validation.captcha.msg }}</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btnSub">
|
||||
<button class="btn btn-primary btn-link" type="submit">ثبت</button>
|
||||
<!-- <nuxt-link >SUBMIT NOW</nuxt-link> -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
message: {
|
||||
name: '',
|
||||
subject: '',
|
||||
description: '',
|
||||
email: '',
|
||||
phoneNumber: '',
|
||||
nationalCode: '',
|
||||
captcha: '',
|
||||
},
|
||||
validation: {},
|
||||
captcha: null
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
reloadCaptcha() {
|
||||
this.$axios.get('/api/public/getCaptcha').then(res => {
|
||||
this.captcha = res.data
|
||||
})
|
||||
},
|
||||
post() {
|
||||
this.validation = {}
|
||||
this.$axios.post('/api/public/meetingOstandar', this.message)
|
||||
.then(res => {
|
||||
this.reloadCaptcha()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: 'پیام شما با موفقیت ارسال شد'
|
||||
})
|
||||
this.message = {
|
||||
name: '',
|
||||
subject: '',
|
||||
description: '',
|
||||
email: '',
|
||||
phoneNumber: '',
|
||||
nationalCode: '',
|
||||
captcha: '',
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.reloadCaptcha()
|
||||
if (e.response.status === 422) this.validation = e.response.data.validation
|
||||
else console.log(e)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
computed: {},
|
||||
async asyncData({$axios, error, params}) {
|
||||
try {
|
||||
|
||||
const request = [
|
||||
$axios.get('/api/public/getCaptcha'),
|
||||
]
|
||||
let fetch = await Promise.all(request)
|
||||
const [captcha] = fetch
|
||||
return {
|
||||
captcha: captcha.data,
|
||||
}
|
||||
} catch (e) {
|
||||
error({
|
||||
status: 500, message: 'دریافت اطلاعات با مشکل مواجه شد!'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user