语言适配
This commit is contained in:
@@ -232,8 +232,7 @@
|
||||
type="checkbox"
|
||||
name="checkbox-question"
|
||||
class="marTop1"
|
||||
:value="othersHelpful"
|
||||
v-model="helpful"
|
||||
ref="helpfulOthers"
|
||||
/>
|
||||
<span> 其他:</span>
|
||||
<textarea
|
||||
@@ -342,9 +341,8 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
name="checkbox-question"
|
||||
:value="othersImprovel"
|
||||
class="marTop1"
|
||||
v-model="improve"
|
||||
ref="improvelOthers"
|
||||
/>
|
||||
<span> 其他:</span>
|
||||
<!-- <input
|
||||
@@ -354,7 +352,7 @@
|
||||
<textarea
|
||||
name="comments"
|
||||
id="text-area"
|
||||
:value="othersImprovel"
|
||||
v-model="othersImprovel"
|
||||
placeholder="请输入..."
|
||||
></textarea>
|
||||
</label>
|
||||
@@ -394,8 +392,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
name="reasonForNotSubscribe"
|
||||
:value="othersIsSubscribeCause"
|
||||
v-model="reasonForNotSubscribe"
|
||||
ref="isSubscribeCauseOthers"
|
||||
class="marTop1"
|
||||
/>
|
||||
<span> 其他:</span>
|
||||
@@ -446,6 +443,11 @@ export default defineComponent({
|
||||
reasonForNotSubscribe:[],
|
||||
designTools:'',
|
||||
});
|
||||
let refList:any = reactive({
|
||||
helpfulOthers:{},
|
||||
improvelOthers:{},
|
||||
isSubscribeCauseOthers:{},
|
||||
})
|
||||
let othersHelpful = ref('')
|
||||
let othersImprovel = ref('')
|
||||
let othersIsSubscribeCause = ref()
|
||||
@@ -619,44 +621,51 @@ export default defineComponent({
|
||||
let setSubmit = () => {
|
||||
let state = false
|
||||
let skipList = ['designTools','reasonForNotSubscribe']
|
||||
for (const key in feedbackData) {
|
||||
|
||||
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) {
|
||||
if(skipList.indexOf(key) > -1){
|
||||
continue
|
||||
}
|
||||
let keyList = ['helpful','improve']
|
||||
if(keyList.indexOf(key) > -1){
|
||||
if(feedbackData[key].length == 0){
|
||||
if(data[key].length == 0){
|
||||
state = true
|
||||
break
|
||||
}
|
||||
}else if(feedbackData.isSubscribe == 'no' && feedbackData.reasonForNotSubscribe.length){
|
||||
}else if(data.isSubscribe == 'no' && data.reasonForNotSubscribe.length == 0){
|
||||
state = true
|
||||
break
|
||||
}else{
|
||||
if(feedbackData[key] == ''){
|
||||
if(data[key] == ''){
|
||||
state = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(state){
|
||||
message.info('Please check that all the * numbers have been filled in')
|
||||
return
|
||||
}
|
||||
let _this = this
|
||||
Modal.confirm({
|
||||
title: `Please confirm your email address to ensure it is correct. ${feedbackData.email}`,
|
||||
title: `Please confirm your email address to ensure it is correct. ${data.email}`,
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
centered:true,
|
||||
onOk() {
|
||||
feedbackData.language = 'CN'
|
||||
submit(JSON.stringify(feedbackData))
|
||||
data.language = 'CN'
|
||||
submit(JSON.stringify(data))
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -668,7 +677,8 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
return {
|
||||
...toRefs(feedbackData),
|
||||
...toRefs(feedbackData),
|
||||
...toRefs(refList),
|
||||
othersHelpful,
|
||||
othersImprovel,
|
||||
othersIsSubscribeCause,
|
||||
|
||||
Reference in New Issue
Block a user