|
|
@@ -38,6 +38,19 @@ interface AvaterItem {
|
|
|
itemtitle: string
|
|
|
changecolortext: boolean
|
|
|
}
|
|
|
+
|
|
|
+interface ScoreOption {
|
|
|
+ label: string
|
|
|
+ value: string
|
|
|
+}
|
|
|
+
|
|
|
+interface SmileAspectsItem {
|
|
|
+ title: string
|
|
|
+ titleLabel: string
|
|
|
+ proposal: ScoreOption[]
|
|
|
+ radio: string
|
|
|
+}
|
|
|
+
|
|
|
const avater = ref<AvaterItem[]>([])
|
|
|
const inputdetails = ref('')
|
|
|
avater.value = [
|
|
|
@@ -92,88 +105,82 @@ avater.value = [
|
|
|
changecolortext: false
|
|
|
}
|
|
|
]
|
|
|
-const checkboxGroup1 = ref([])
|
|
|
-const checkboxGroup2 = ref([])
|
|
|
+const checkboxGroup1 = ref<string[]>([])
|
|
|
+const checkboxGroup2 = ref<string[]>([])
|
|
|
const evaluate = [
|
|
|
- t('dashboard.functionality'),
|
|
|
- t('dashboard.dataAccuracy'),
|
|
|
- t('dashboard.lookAndFeel'),
|
|
|
- t('dashboard.easeOfUse'),
|
|
|
- t('dashboard.websitePerformance')
|
|
|
-]
|
|
|
-const happyevaluate = [
|
|
|
- t('dashboard.functionality'),
|
|
|
- t('dashboard.dataAccuracy'),
|
|
|
- t('dashboard.lookAndFeel'),
|
|
|
- t('dashboard.easeOfUse'),
|
|
|
- t('dashboard.websitePerformance')
|
|
|
+ { label: t('dashboard.functionality'), value: 'functionality' },
|
|
|
+ { label: t('dashboard.dataAccuracy'), value: 'dataAccuracy' },
|
|
|
+ { label: t('dashboard.lookAndFeel'), value: 'lookAndFeel' },
|
|
|
+ { label: t('dashboard.easeOfUse'), value: 'easeOfUse' },
|
|
|
+ { label: t('dashboard.websitePerformance'), value: 'websitePerformance' }
|
|
|
]
|
|
|
+const happyevaluate = evaluate
|
|
|
const Aspects = ref([
|
|
|
- t('dashboard.highlyDissatisfied'),
|
|
|
- t('dashboard.dissatisfied'),
|
|
|
- t('dashboard.neutral'),
|
|
|
- t('dashboard.satisfied'),
|
|
|
- t('dashboard.highlySatisfied')
|
|
|
+ { label: t('dashboard.highlyDissatisfied'), value: 'highlyDissatisfied' },
|
|
|
+ { label: t('dashboard.dissatisfied'), value: 'dissatisfied' },
|
|
|
+ { label: t('dashboard.neutral'), value: 'neutral' },
|
|
|
+ { label: t('dashboard.satisfied'), value: 'satisfied' },
|
|
|
+ { label: t('dashboard.highlySatisfied'), value: 'highlySatisfied' }
|
|
|
])
|
|
|
-interface smileAspectsItem {
|
|
|
- title: string
|
|
|
- proposal: Array<string>
|
|
|
- radio: string
|
|
|
-}
|
|
|
-const smileAspects = ref<smileAspectsItem[]>([])
|
|
|
+const smileAspects = ref<SmileAspectsItem[]>([])
|
|
|
smileAspects.value = [
|
|
|
{
|
|
|
- title: t('dashboard.functionality'),
|
|
|
+ title: 'functionality',
|
|
|
+ titleLabel: t('dashboard.functionality'),
|
|
|
proposal: [
|
|
|
- t('dashboard.highlyDissatisfied'),
|
|
|
- t('dashboard.dissatisfied'),
|
|
|
- t('dashboard.neutral'),
|
|
|
- t('dashboard.satisfied'),
|
|
|
- t('dashboard.highlySatisfied')
|
|
|
+ { label: t('dashboard.highlyDissatisfied'), value: 'highlyDissatisfied' },
|
|
|
+ { label: t('dashboard.dissatisfied'), value: 'dissatisfied' },
|
|
|
+ { label: t('dashboard.neutral'), value: 'neutral' },
|
|
|
+ { label: t('dashboard.satisfied'), value: 'satisfied' },
|
|
|
+ { label: t('dashboard.highlySatisfied'), value: 'highlySatisfied' }
|
|
|
],
|
|
|
radio: ''
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.dataAccuracy'),
|
|
|
+ title: 'dataAccuracy',
|
|
|
+ titleLabel: t('dashboard.dataAccuracy'),
|
|
|
proposal: [
|
|
|
- t('dashboard.highlyDissatisfied'),
|
|
|
- t('dashboard.dissatisfied'),
|
|
|
- t('dashboard.neutral'),
|
|
|
- t('dashboard.satisfied'),
|
|
|
- t('dashboard.highlySatisfied')
|
|
|
+ { label: t('dashboard.highlyDissatisfied'), value: 'highlyDissatisfied' },
|
|
|
+ { label: t('dashboard.dissatisfied'), value: 'dissatisfied' },
|
|
|
+ { label: t('dashboard.neutral'), value: 'neutral' },
|
|
|
+ { label: t('dashboard.satisfied'), value: 'satisfied' },
|
|
|
+ { label: t('dashboard.highlySatisfied'), value: 'highlySatisfied' }
|
|
|
],
|
|
|
radio: ''
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.lookAndFeel'),
|
|
|
+ title: 'lookAndFeel',
|
|
|
+ titleLabel: t('dashboard.lookAndFeel'),
|
|
|
proposal: [
|
|
|
- t('dashboard.highlyDissatisfied'),
|
|
|
- t('dashboard.dissatisfied'),
|
|
|
- t('dashboard.neutral'),
|
|
|
- t('dashboard.satisfied'),
|
|
|
- t('dashboard.highlySatisfied')
|
|
|
+ { label: t('dashboard.highlyDissatisfied'), value: 'highlyDissatisfied' },
|
|
|
+ { label: t('dashboard.dissatisfied'), value: 'dissatisfied' },
|
|
|
+ { label: t('dashboard.neutral'), value: 'neutral' },
|
|
|
+ { label: t('dashboard.satisfied'), value: 'satisfied' },
|
|
|
+ { label: t('dashboard.highlySatisfied'), value: 'highlySatisfied' }
|
|
|
],
|
|
|
radio: ''
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.easeOfUse'),
|
|
|
+ title: 'easeOfUse',
|
|
|
+ titleLabel: t('dashboard.easeOfUse'),
|
|
|
proposal: [
|
|
|
- t('dashboard.highlyDissatisfied'),
|
|
|
- t('dashboard.dissatisfied'),
|
|
|
- t('dashboard.neutral'),
|
|
|
- t('dashboard.satisfied'),
|
|
|
- t('dashboard.highlySatisfied')
|
|
|
+ { label: t('dashboard.highlyDissatisfied'), value: 'highlyDissatisfied' },
|
|
|
+ { label: t('dashboard.dissatisfied'), value: 'dissatisfied' },
|
|
|
+ { label: t('dashboard.neutral'), value: 'neutral' },
|
|
|
+ { label: t('dashboard.satisfied'), value: 'satisfied' },
|
|
|
+ { label: t('dashboard.highlySatisfied'), value: 'highlySatisfied' }
|
|
|
],
|
|
|
radio: ''
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.websitePerformance'),
|
|
|
+ title: 'websitePerformance',
|
|
|
+ titleLabel: t('dashboard.websitePerformance'),
|
|
|
proposal: [
|
|
|
- t('dashboard.highlyDissatisfied'),
|
|
|
- t('dashboard.dissatisfied'),
|
|
|
- t('dashboard.neutral'),
|
|
|
- t('dashboard.satisfied'),
|
|
|
- t('dashboard.highlySatisfied')
|
|
|
+ { label: t('dashboard.highlyDissatisfied'), value: 'highlyDissatisfied' },
|
|
|
+ { label: t('dashboard.dissatisfied'), value: 'dissatisfied' },
|
|
|
+ { label: t('dashboard.neutral'), value: 'neutral' },
|
|
|
+ { label: t('dashboard.satisfied'), value: 'satisfied' },
|
|
|
+ { label: t('dashboard.highlySatisfied'), value: 'highlySatisfied' }
|
|
|
],
|
|
|
radio: ''
|
|
|
}
|
|
|
@@ -262,20 +269,22 @@ const changeHappyDetails = () => {
|
|
|
}
|
|
|
let SmileObj: any = {}
|
|
|
const smilecheckbox = ref()
|
|
|
-const changeSmileRadio = (title: any, value: any) => {
|
|
|
+const changeSmileRadio = (title: string, value: string) => {
|
|
|
SmileObj[title] = value
|
|
|
smilecheckbox.value = SmileObj
|
|
|
if (Object.keys(SmileObj).length == Aspects.value.length) {
|
|
|
buttonDisabled.value = false
|
|
|
}
|
|
|
}
|
|
|
+const getSelectedLabels = (options: ScoreOption[], selectedValues: string[]) =>
|
|
|
+ options.filter((item) => selectedValues.includes(item.value)).map((item) => item.label)
|
|
|
// 提交details
|
|
|
const submitDetails = (val: any) => {
|
|
|
const username = userStore.userName
|
|
|
if (checkboxGroup1.value.length) {
|
|
|
$api
|
|
|
.scoringgrade({
|
|
|
- suggestion: checkboxGroup1.value,
|
|
|
+ suggestion: getSelectedLabels(evaluate, checkboxGroup1.value),
|
|
|
proposal: val,
|
|
|
expression: checkexpression.value,
|
|
|
username: username
|
|
|
@@ -292,7 +301,7 @@ const submitDetails = (val: any) => {
|
|
|
} else if (checkboxGroup2.value.length) {
|
|
|
$api
|
|
|
.scoringgrade({
|
|
|
- suggestion: checkboxGroup2.value,
|
|
|
+ suggestion: getSelectedLabels(happyevaluate, checkboxGroup2.value),
|
|
|
proposal: val,
|
|
|
expression: checkexpression.value
|
|
|
})
|
|
|
@@ -310,7 +319,9 @@ const submitDetails = (val: any) => {
|
|
|
.scoringgrade({
|
|
|
proposal: val,
|
|
|
expression: checkexpression.value,
|
|
|
- ...smilecheckbox.value
|
|
|
+ ...Object.fromEntries(
|
|
|
+ Object.entries(smilecheckbox.value).map(([key, value]) => [key, value])
|
|
|
+ )
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
if (res.code == 200) {
|
|
|
@@ -379,10 +390,10 @@ const submitDetails = (val: any) => {
|
|
|
<el-checkbox-button
|
|
|
@change="changeAngryDetails"
|
|
|
v-for="item in evaluate"
|
|
|
- :key="item"
|
|
|
- :value="item"
|
|
|
+ :key="item.value"
|
|
|
+ :value="item.value"
|
|
|
>
|
|
|
- {{ item }}
|
|
|
+ {{ item.label }}
|
|
|
</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
@@ -390,13 +401,13 @@ const submitDetails = (val: any) => {
|
|
|
<div class="smile_flex">
|
|
|
<div class="smile_title_left"></div>
|
|
|
<div class="smile_title_right">
|
|
|
- <div class="smile_title" v-for="item in Aspects" :key="item">
|
|
|
- {{ item }}
|
|
|
+ <div class="smile_title" v-for="item in Aspects" :key="item.value">
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="smile_content_flex" v-for="(item, index) in smileAspects" :key="index">
|
|
|
- <div class="smile_title_left content_left">{{ item.title }}</div>
|
|
|
+ <div class="smile_title_left content_left">{{ item.titleLabel }}</div>
|
|
|
<div class="smile_title_right content_right">
|
|
|
<el-radio-group
|
|
|
v-model="item.radio"
|
|
|
@@ -405,8 +416,8 @@ const submitDetails = (val: any) => {
|
|
|
<el-radio
|
|
|
class="smile_radio"
|
|
|
v-for="proposal in item.proposal"
|
|
|
- :value="proposal"
|
|
|
- :key="proposal"
|
|
|
+ :value="proposal.value"
|
|
|
+ :key="proposal.value"
|
|
|
></el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
@@ -417,10 +428,10 @@ const submitDetails = (val: any) => {
|
|
|
<el-checkbox-button
|
|
|
@change="changeHappyDetails"
|
|
|
v-for="item in happyevaluate"
|
|
|
- :key="item"
|
|
|
- :value="item"
|
|
|
+ :key="item.value"
|
|
|
+ :value="item.value"
|
|
|
>
|
|
|
- {{ item }}
|
|
|
+ {{ item.label }}
|
|
|
</el-checkbox-button>
|
|
|
</el-checkbox-group>
|
|
|
</div>
|