语言适配

This commit is contained in:
X1627315083
2024-06-21 10:30:09 +08:00
parent dc93403506
commit 8b0af784de
20 changed files with 476 additions and 150 deletions

View File

@@ -233,8 +233,7 @@
type="checkbox"
name="checkbox-question"
class="marTop1"
:value="othersHelpful"
v-model="helpful"
ref="helpfulOthers"
/>
<span> Others:</span>
<textarea
@@ -345,9 +344,8 @@
<input
type="checkbox"
name="checkbox-question"
:value="othersImprovel"
class="marTop1"
v-model="improve"
ref="improvelOthers"
/>
<span> Others:</span>
<!-- <input
@@ -357,7 +355,7 @@
<textarea
name="comments"
id="text-area"
:value="othersImprovel"
v-model="othersImprovel"
placeholder="Please enter..."
></textarea>
</label>
@@ -397,8 +395,7 @@
<input
type="checkbox"
name="reasonForNotSubscribe"
:value="othersIsSubscribeCause"
v-model="reasonForNotSubscribe"
ref="isSubscribeCauseOthers"
class="marTop1"
/>
<span> Others:</span>
@@ -450,6 +447,11 @@ export default defineComponent({
reasonForNotSubscribe:[],
designTools:'',
});
let refList:any = reactive({
helpfulOthers:{},
improvelOthers:{},
isSubscribeCauseOthers:{},
})
let othersHelpful = ref('')
let othersImprovel = ref('')
let othersIsSubscribeCause = ref()
@@ -623,44 +625,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 = 'EN'
submit(JSON.stringify(feedbackData))
data.language = 'EN'
submit(JSON.stringify(data))
}
});
};
@@ -673,8 +682,10 @@ export default defineComponent({
).catch(res=>{
});
}
return {
...toRefs(feedbackData),
...toRefs(refList),
othersHelpful,
othersImprovel,
othersIsSubscribeCause,