Files
aida_front/src/views/feedbackSurvey.vue

866 lines
24 KiB
Vue
Raw Normal View History

2024-06-18 10:45:15 +08:00
<template>
<div class="feedbackSurvey">
<main id="main">
<h1 id="title">AiDA 3.0 Feedback Survey</h1>
<p id="description">Please take the survey</p>
2024-06-20 10:36:45 +08:00
<div id="survey-form">
2024-06-18 10:45:15 +08:00
<h2 class="section-title">Personal Information</h2>
<div class="section w40">
<label for="name"
>Name:<span class="fontColor">*</span></label
>
<input
type="text"
v-model="userName"
placeholder="Enter your name"
/>
</div>
<div class="section w40">
<label for="gender"
>Gender:<span class="fontColor">*</span></label
>
2024-06-20 10:36:45 +08:00
<select name="dropdown" id="dropdown" v-model="gender">
<option selected value='Female'>Female</option>
<option value='Male'>Male</option>
</select>
<!-- <input
2024-06-18 10:45:15 +08:00
type="text"
v-model="gender"
placeholder="Enter your gender"
required
2024-06-20 10:36:45 +08:00
/> -->
2024-06-18 10:45:15 +08:00
</div>
<div class="section w40">
<label for="occupation"
>Occupation:<span class="fontColor">*</span></label
>
2024-06-20 10:36:45 +08:00
2024-06-18 10:45:15 +08:00
<input
type="text"
v-model="occupation"
placeholder="Enter your occupation"
required
/>
</div>
<!-- <div class="section w40">
<label for="country"
>Country of Origin:<span class="fontColor" >*</span
></label
>
<input
type="text"
id="country"
name="country"
placeholder="Enter your country of origin"
required
/>
</div> -->
<div class="section w40">
<label for="dropdown">Country of Origin:<span class="fontColor" >*</span></label>
<select name="dropdown" id="dropdown" v-model="country" required>
<option disabled selected value> Select an option </option>
<option v-for="item in CountryList" :key="item" :value="item">{{ item }}</option>
</select>
</div>
<div class="section">
<label for="email"
>Email:<span class="fontColor">*</span></label
>
<input
type="email"
v-model="email"
placeholder="Enter your email"
required
/>
</div>
<div class="section">
<p>Age Group:<span class="fontColor">*</span></p>
<label>
<input
type="radio"
value="below20"
name="age"
v-model="age"
2024-06-20 10:36:45 +08:00
2024-06-18 10:45:15 +08:00
/>
Below 20
</label>
<label>
2024-06-20 10:36:45 +08:00
<input checked type="radio" value="20-30" v-model="age" name="age" />
2024-06-18 10:45:15 +08:00
20-30
</label>
<label>
<input type="radio" value="30-40" v-model="age" name="age" />
30-40
</label>
<label>
<input type="radio" value="40+" v-model="age" name="age" />
40+
</label>
</div>
<h2 class="section-title">Survey Questions</h2>
<!-- <div class="section">
<p>Do you like this survey?</p>
<label>
<input
type="radio"
value="yes"
name="radio-question"
checked
/>
Yes
</label>
<label>
<input type="radio" value="no" name="radio-question" />
No
</label>
<label>
<input
type="radio"
value="maybe"
name="radio-question"
/>
Maybe
</label>
</div> -->
<div class="section">
<p>
1. How has AiDA been helpful to you? (You can choose
more than one answer):<span class="fontColor">*</span>
</p>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="1"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
Easy to learn and use
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="2"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
Easy to get trend information
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="3"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
Lots of creative design proposals
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="4"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
The AIGC functions for moodboard is helpful
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="5"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
The AIGC functions for design sketches is helpful
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="6"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
Easy to select the right color
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="7"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
The Chatbot function is helpful
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="8"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
The print position function is helpful
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="9"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
The drawing function is helpful
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="10"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
The export function is useful
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="11"
2024-06-18 10:45:15 +08:00
v-model="helpful"
/>
Easy to edit the design
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
class="marTop1"
2024-06-21 10:30:09 +08:00
ref="helpfulOthers"
2024-06-18 10:45:15 +08:00
/>
<span> Others:</span>
<textarea
name="comments"
id="text-area"
placeholder="Please enter..."
2024-06-20 10:36:45 +08:00
v-model="othersHelpful"
2024-06-28 11:50:11 +08:00
@input="()=>helpfulOthers.checked = true"
2024-06-18 10:45:15 +08:00
></textarea>
</label>
</div>
<div class="section">
<p>
2024-06-20 10:36:45 +08:00
2. What do you think AiDA should improve? (you could choose
2024-06-18 10:45:15 +08:00
more than one answer):<span class="fontColor">*</span>
</p>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="1"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Proposed designs are boring, need more interesting
designs
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="2"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Difficult to make changes on design
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="3"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Only 2D output, no 3D results
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="4"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Difficult to apply keywords for AIGC generation
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="5"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Clothing is not in the right proportion
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="6"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Not compatible with pattern making solutions
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="7"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Improved user interface for better navigation
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="8"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Lack of responsive customer support
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="9"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Insufficient tutorial or guidance for new users
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
2024-06-20 10:36:45 +08:00
value="10"
v-model="improve"
2024-06-18 10:45:15 +08:00
/>
Limited personalization options for designs
</label>
<label>
<input
type="checkbox"
name="checkbox-question"
class="marTop1"
2024-06-21 10:30:09 +08:00
ref="improvelOthers"
2024-06-18 10:45:15 +08:00
/>
<span> Others:</span>
<!-- <input
class="others-input"
type="text"
/> -->
<textarea
name="comments"
id="text-area"
2024-06-21 10:30:09 +08:00
v-model="othersImprovel"
2024-06-18 10:45:15 +08:00
placeholder="Please enter..."
2024-06-28 11:50:11 +08:00
@input="()=>improvelOthers.checked = true"
2024-06-18 10:45:15 +08:00
></textarea>
</label>
</div>
<div class="section">
<p>3. Will you subscribe to AiDA 3.0?<span class="fontColor">*</span></p>
<label>
<input
type="radio"
value="yes"
2024-06-20 10:36:45 +08:00
v-model="isSubscribe"
2024-06-18 10:45:15 +08:00
name="radio-question"
/>
Yes
</label>
<label>
2024-06-20 10:36:45 +08:00
<input v-model="isSubscribe" type="radio" value="no" name="radio-question" />
2024-06-18 10:45:15 +08:00
No
</label>
</div>
2024-06-20 10:36:45 +08:00
<div class="section" v-show="isSubscribe == 'no'">
<p>If NO, please share why:<span class="fontColor">*</span></p>
2024-06-18 10:45:15 +08:00
<label>
<input
2024-06-20 10:36:45 +08:00
type="checkbox"
value="Not useful"
name="reasonForNotSubscribe"
v-model="reasonForNotSubscribe"
2024-06-18 10:45:15 +08:00
/>
Not useful
</label>
<label>
2024-06-20 10:36:45 +08:00
<input type="checkbox" value="Too expensive" v-model="reasonForNotSubscribe" name="reasonForNotSubscribe" />
2024-06-18 10:45:15 +08:00
Too expensive
</label>
<label>
<input
type="checkbox"
2024-06-20 10:36:45 +08:00
name="reasonForNotSubscribe"
2024-06-21 10:30:09 +08:00
ref="isSubscribeCauseOthers"
2024-06-18 10:45:15 +08:00
class="marTop1"
/>
<span> Others:</span>
<textarea
name="comments"
id="text-area"
2024-06-20 10:36:45 +08:00
v-model="othersIsSubscribeCause"
2024-06-18 10:45:15 +08:00
placeholder="Please enter..."
2024-06-28 11:50:11 +08:00
@input="()=>isSubscribeCauseOthers.checked = true"
2024-06-18 10:45:15 +08:00
></textarea>
</label>
</div>
<div class="section">
<p>
2024-06-20 10:36:45 +08:00
Are you currently using any design tools? Please
2024-06-18 10:45:15 +08:00
list:
</p>
<textarea
name="comments"
id="text-area"
2024-06-20 10:36:45 +08:00
v-model="designTools"
2024-06-18 10:45:15 +08:00
placeholder="Please enter..."
></textarea>
</div>
<div class="section">
<button id="submit" @click="setSubmit">Submit</button>
</div>
2024-06-20 10:36:45 +08:00
</div>
2024-06-18 10:45:15 +08:00
</main>
</div>
</template>
<script lang="ts">
2024-06-20 10:36:45 +08:00
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { Modal,message } from 'ant-design-vue';
import { Https } from "@/tool/https";
import { defineComponent, toRefs,ref, reactive, createVNode } from "vue";
2024-06-18 10:45:15 +08:00
export default defineComponent({
setup() {
2024-06-20 10:36:45 +08:00
const feedbackData:any = reactive({
2024-06-18 10:45:15 +08:00
userName:'',
2024-06-20 10:36:45 +08:00
gender:'Female',
2024-06-18 10:45:15 +08:00
occupation:'',
country:'',
email:'',
2024-06-20 10:36:45 +08:00
age:'20-30',
helpful:[],
improve:[],
2024-06-18 10:45:15 +08:00
isSubscribe:'',
2024-06-20 10:36:45 +08:00
reasonForNotSubscribe:[],
2024-06-18 10:45:15 +08:00
designTools:'',
});
2024-06-21 10:30:09 +08:00
let refList:any = reactive({
helpfulOthers:{},
improvelOthers:{},
isSubscribeCauseOthers:{},
})
2024-06-20 10:36:45 +08:00
let othersHelpful = ref('')
let othersImprovel = ref('')
let othersIsSubscribeCause = ref()
2024-06-18 10:45:15 +08:00
let CountryList = [
"Albania",
"Algeria",
"Andorra",
"Angola",
"Antigua and Barbuda",
"Argentina",
"Armenia",
"Australia",
"Austria",
"Azerbaijan",
"Bahamas",
"Bangladesh",
"Barbados",
"Belgium",
"Belize",
"Benin",
"Bhutan",
"Bolivia",
"Bosnia and Herzegovina",
"Botswana",
"Brazil",
"Brunei",
"Bulgaria",
"Burkina Faso",
"Cabo Verde",
"Canada",
"China",
"Chile",
"Colombia",
"Comoros",
"Congo",
"Costa Rica",
"Côte d'Ivoire",
"Croatia",
"Cyprus",
"Czech Republic",
"Denmark",
"Djibouti",
"Dominica",
"Dominican Republic",
"Ecuador",
"El Salvador",
"Estonia",
"Fiji",
"Finland",
"France",
"Gabon",
"Gambia",
"Georgia",
"Germany",
"Ghana",
"Greece",
"Grenada",
"Guatemala",
"Guinea",
"Guinea-Bissau",
"Guyana",
"Haiti",
"Holy See",
"Honduras",
"Hong Kong, China",
"Hungary",
"Iceland",
"India",
"Indonesia",
"Iraq",
"Ireland",
"Israel",
"Italy",
"Jamaica",
"Japan",
"Jordan",
"Kazakhstan",
"Kenya",
"Kiribati",
"Kuwait",
"Kyrgyzstan",
"Latvia",
"Lebanon",
"Lesotho",
"Liberia",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Madagascar",
"Malawi",
"Malaysia",
"Maldives",
"Mali",
"Malta",
"Marshall Islands",
"Mauritania",
"Mauritius",
"Mexico",
"Micronesia",
"Moldova",
"Monaco",
"Mongolia",
"Montenegro",
"Morocco",
"Mozambique",
"Myanmar",
"Namibia",
"Nauru",
"Nepal",
"Netherlands",
"New Zealand",
"Nicaragua",
"Niger",
"Nigeria",
"North Macedonia",
"Norway",
"Oman",
"Pakistan",
"Palau",
"Palestine",
"Panama",
"Papua New Guinea",
"Paraguay",
"Peru",
"Philippines",
"Poland",
"Portugal",
"Qatar",
"Romania",
"Rwanda",
"Saint Kitts and Nevis",
"Saint Lucia",
"Saint Vincent and the Grenadines",
"Samoa",
"San Marino",
"Sao Tome and Principe",
"Senegal",
"Serbia",
"Seychelles",
"Sierra Leone",
"Singapore",
"Slovakia",
"Slovenia",
"Solomon Islands",
"South Africa",
"South Korea",
"Spain",
"Sri Lanka",
"Suriname",
"Sweden",
"Switzerland",
"Taiwan, China",
"Tanzania",
"Thailand",
"Timor-Leste",
"Togo",
"Tonga",
"Trinidad and Tobago",
"Tunisia",
"Turkey",
"Tuvalu",
"Uganda",
"Ukraine",
"United Arab Emirates",
"United Kingdom",
"United States of America",
"Uruguay",
"Vanuatu",
"Zambia"
]
let setSubmit = () => {
2024-06-20 10:36:45 +08:00
let state = false
let skipList = ['designTools','reasonForNotSubscribe']
2024-06-21 10:30:09 +08:00
let data = JSON.parse(JSON.stringify(feedbackData))
if(refList.helpfulOthers.checked && othersHelpful.value){
data.helpful.push(othersHelpful.value)
}
if(refList.improvelOthers.checked && othersImprovel.value){
data.improve.push(othersImprovel.value)
}
if(refList.isSubscribeCauseOthers.checked && othersIsSubscribeCause.value){
data.reasonForNotSubscribe.push(othersIsSubscribeCause.value)
}
for (const key in data) {
2024-06-20 10:36:45 +08:00
if(skipList.indexOf(key) > -1){
continue
}
let keyList = ['helpful','improve']
if(keyList.indexOf(key) > -1){
2024-06-21 10:30:09 +08:00
if(data[key].length == 0){
2024-06-20 10:36:45 +08:00
state = true
break
}
2024-06-21 10:30:09 +08:00
}else if(data.isSubscribe == 'no' && data.reasonForNotSubscribe.length == 0){
2024-06-20 10:36:45 +08:00
state = true
break
}else{
2024-06-21 10:30:09 +08:00
if(data[key] == ''){
2024-06-20 10:36:45 +08:00
state = true
break
}
}
}
if(state){
message.info('Please check that all the * numbers have been filled in')
return
}
Modal.confirm({
2024-06-21 10:30:09 +08:00
title: `Please confirm your email address to ensure it is correct. ${data.email}`,
2024-06-20 10:36:45 +08:00
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
mask:false,
centered:true,
onOk() {
2024-06-21 10:30:09 +08:00
data.language = 'EN'
submit(JSON.stringify(data))
2024-06-20 10:36:45 +08:00
}
});
2024-06-18 10:45:15 +08:00
};
2024-06-20 10:36:45 +08:00
let submit = (value:any)=>{
Https.axiosPost(Https.httpUrls.questionnaire, value).then(
(rv) => {
alert('Submit Successfully!')
2024-06-20 10:36:45 +08:00
}
).catch(res=>{
});
}
2024-06-21 10:30:09 +08:00
2024-06-18 10:45:15 +08:00
return {
...toRefs(feedbackData),
2024-06-21 10:30:09 +08:00
...toRefs(refList),
2024-06-20 10:36:45 +08:00
othersHelpful,
othersImprovel,
othersIsSubscribeCause,
2024-06-18 10:45:15 +08:00
CountryList,
setSubmit,
};
},
data() {
return {
// moodTemplateId: "", //模板id
};
},
mounted() {},
methods: {},
});
</script>
<style lang="less" scoped>
@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;700&display=swap");
.feedbackSurvey {
font-family: "Quicksand", sans-serif;
text-align: center;
line-height: 1.5;
// background: linear-gradient(180deg, #f3f3e6 0%, #eee4f3 100%);
margin: 1rem;
height: 100%;
overflow-y: auto;
#main{
background: linear-gradient(45deg, #eee4f3, #f3f4e6);
}
#title {
font-size: 6rem;
margin: 0;
font-weight: 900;
}
#description {
font-size: 2.8rem;
font-style: italic;
}
2024-06-20 10:36:45 +08:00
#survey-form {
2024-06-18 10:45:15 +08:00
position: relative;
background: rgba(255, 255, 255, 0.2);
width: 60%;
left: 50%;
transform: translateX(-50%);
text-align: left;
border-radius: 15px;
padding: 3rem;
box-shadow: -1px 1px 5px 0.5px;
font-size: 2.4rem;
transition: width 1s ease;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
@media (max-width: 760px) {
form {
width: 75%;
}
}
h2 {
width: 100%;
font-weight: 900;
}
.section {
display: flex;
flex-direction: column;
margin: 1rem;
width: 100%;
}
.w40 {
width: 40%;
}
.fontColor{
color: rgb(255, 2, 2);
}
p{
font-size: 2.8rem;
}
p,
label {
font-weight: bold;
margin: 0;
margin-left: 5px;
}
input,
#dropdown {
border: none;
border-radius: 5px;
padding: 10px;
outline: 0;
}
input:focus,
#dropdown:focus {
border: 2px solid rgb(173, 173, 173);
}
2024-06-20 10:36:45 +08:00
input,select{
height: 7rem;
2024-06-20 10:36:45 +08:00
}
2024-06-18 10:45:15 +08:00
input,
button,
select,
textarea {
cursor: pointer;
font-family: inherit;
font-size: inherit;
}
input[type="radio"],
input[type="checkbox"] {
display: inline-block;
width: 2rem;
height: 2rem;
vertical-align: middle;
margin: 0;
}
label{
vertical-align: baseline;
cursor: pointer;
.others-input{
background: rgba(255, 255, 255, 0);
border-top: none;
border-right: none;
border-left: none;
border-radius: 0;
border-bottom: 2px solid;
}
.others-input:focus{
border: none;
border-bottom: 2px solid;
}
span{
vertical-align: top;
}
textarea{
width: 80%;
vertical-align: top;
margin-left: 1rem;
}
}
textarea {
min-height: 75%;
max-height: 250px;
width: 100%;
resize: vertical;
border: none;
border-radius: 10px;
padding: 10px;
box-sizing: border-box;
}
#submit {
background: green;
background: #39215b;
border: none;
border-radius: 10px;
color: white;
font-size: 3rem;
transition: all 0.3s ease-in;
}
#submit:hover {
background: darkgreen;
background: #543087;
}
}
</style>