Ver código fonte

国际站国家地区选择多语言&&答题卡配置完善

OnePsycho 3 anos atrás
pai
commit
b47f4efe7b

+ 338 - 0
TEAMModelOS/ClientApp/src/static/twJsonT.js

@@ -0,0 +1,338 @@
+export default [
+        {
+            "areas": [
+                {
+                    "area": "中正區",
+                    "areaID": "710101"
+                },
+                {
+                    "area": "大同區",
+                    "areaID": "710102"
+                },
+                {
+                    "area": "中山區",
+                    "areaID": "710103"
+                },
+                {
+                    "area": "松山區",
+                    "areaID": "710104"
+                },
+                {
+                    "area": "大安區",
+                    "areaID": "710105"
+                },
+                {
+                    "area": "萬華區",
+                    "areaID": "710106"
+                },
+                {
+                    "area": "信義區",
+                    "areaID": "710107"
+                },
+                {
+                    "area": "士林區",
+                    "areaID": "710108"
+                },
+                {
+                    "area": "北投區",
+                    "areaID": "710109"
+                },
+                {
+                    "area": "內湖區",
+                    "areaID": "710110"
+                },
+                {
+                    "area": "南港區",
+                    "areaID": "710111"
+                },
+                {
+                    "area": "文山區",
+                    "areaID": "710112"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710113"
+                }
+            ],
+            "city": "臺北市",
+            "cityID": "710100"
+        },
+        {
+            "areas": [
+                {
+                    "area": "新興區",
+                    "areaID": "710201"
+                },
+                {
+                    "area": "前金區",
+                    "areaID": "710202"
+                },
+                {
+                    "area": "芩雅區",
+                    "areaID": "710203"
+                },
+                {
+                    "area": "鹽埕區",
+                    "areaID": "710204"
+                },
+                {
+                    "area": "鼓山區",
+                    "areaID": "710205"
+                },
+                {
+                    "area": "旗津區",
+                    "areaID": "710206"
+                },
+                {
+                    "area": "前鎮區",
+                    "areaID": "710207"
+                },
+                {
+                    "area": "三民區",
+                    "areaID": "710208"
+                },
+                {
+                    "area": "左營區",
+                    "areaID": "710209"
+                },
+                {
+                    "area": "楠梓區",
+                    "areaID": "710210"
+                },
+                {
+                    "area": "小港區",
+                    "areaID": "710211"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710212"
+                }
+            ],
+            "city": "高雄市",
+            "cityID": "710200"
+        },
+        {
+            "areas": [
+                {
+                    "area": "中西區",
+                    "areaID": "710301"
+                },
+                {
+                    "area": "東區",
+                    "areaID": "710302"
+                },
+                {
+                    "area": "南區",
+                    "areaID": "710303"
+                },
+                {
+                    "area": "北區",
+                    "areaID": "710304"
+                },
+                {
+                    "area": "安平區",
+                    "areaID": "710305"
+                },
+                {
+                    "area": "安南區",
+                    "areaID": "710306"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710307"
+                }
+            ],
+            "city": "臺南市",
+            "cityID": "710300"
+        },
+        {
+            "areas": [
+                {
+                    "area": "中區",
+                    "areaID": "710401"
+                },
+                {
+                    "area": "東區",
+                    "areaID": "710402"
+                },
+                {
+                    "area": "南區",
+                    "areaID": "710403"
+                },
+                {
+                    "area": "西區",
+                    "areaID": "710404"
+                },
+                {
+                    "area": "北區",
+                    "areaID": "710405"
+                },
+                {
+                    "area": "北屯區",
+                    "areaID": "710406"
+                },
+                {
+                    "area": "西屯區",
+                    "areaID": "710407"
+                },
+                {
+                    "area": "南屯區",
+                    "areaID": "710408"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710409"
+                }
+            ],
+            "city": "臺中市",
+            "cityID": "710400"
+        },
+        {
+            "areas": [],
+            "city": "金門縣",
+            "cityID": "710500"
+        },
+        {
+            "areas": [],
+            "city": "南投縣",
+            "cityID": "710600"
+        },
+        {
+            "areas": [
+                {
+                    "area": "仁愛區",
+                    "areaID": "710701"
+                },
+                {
+                    "area": "信義區",
+                    "areaID": "710702"
+                },
+                {
+                    "area": "中正區",
+                    "areaID": "710703"
+                },
+                {
+                    "area": "中山區",
+                    "areaID": "710704"
+                },
+                {
+                    "area": "安樂區",
+                    "areaID": "710705"
+                },
+                {
+                    "area": "暖暖區",
+                    "areaID": "710706"
+                },
+                {
+                    "area": "七堵區",
+                    "areaID": "710707"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710708"
+                }
+            ],
+            "city": "基隆市",
+            "cityID": "710700"
+        },
+        {
+            "areas": [
+                {
+                    "area": "東區",
+                    "areaID": "710801"
+                },
+                {
+                    "area": "北區",
+                    "areaID": "710802"
+                },
+                {
+                    "area": "香山區",
+                    "areaID": "710803"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710804"
+                }
+            ],
+            "city": "新竹市",
+            "cityID": "710800"
+        },
+        {
+            "areas": [
+                {
+                    "area": "東區",
+                    "areaID": "710901"
+                },
+                {
+                    "area": "西區",
+                    "areaID": "710902"
+                },
+                {
+                    "area": "其它區",
+                    "areaID": "710903"
+                }
+            ],
+            "city": "嘉義市",
+            "cityID": "710900"
+        },
+        {
+            "areas": [],
+            "city": "新北市",
+            "cityID": "711100"
+        },
+        {
+            "areas": [],
+            "city": "宜蘭縣",
+            "cityID": "711200"
+        },
+        {
+            "areas": [],
+            "city": "新竹縣",
+            "cityID": "711300"
+        },
+        {
+            "areas": [],
+            "city": "桃園縣",
+            "cityID": "711400"
+        },
+        {
+            "areas": [],
+            "city": "苗栗縣",
+            "cityID": "711500"
+        },
+        {
+            "areas": [],
+            "city": "彰化縣",
+            "cityID": "711700"
+        },
+        {
+            "areas": [],
+            "city": "嘉義縣",
+            "cityID": "711900"
+        },
+        {
+            "areas": [],
+            "city": "雲林縣",
+            "cityID": "712100"
+        },
+        {
+            "areas": [],
+            "city": "屏東縣",
+            "cityID": "712400"
+        },
+        {
+            "areas": [],
+            "city": "臺東縣",
+            "cityID": "712500"
+        },
+        {
+            "areas": [],
+            "city": "花蓮縣",
+            "cityID": "712600"
+        },
+        {
+            "areas": [],
+            "city": "澎湖縣",
+            "cityID": "712700"
+        }
+    ]

+ 6 - 7
TEAMModelOS/ClientApp/src/store/module/answerSheet.js

@@ -105,12 +105,13 @@ export default {
 		},
 		// 设置信息填写区域的配置数据
 		setInfoConfig(state, val) {
-			val.index = state.config.contents.filter(i => i.pageNum === val.pageNum && !i.isFix).length + ''
+			val.index = 1
 			val.x = Number(val.x.toFixed())
 			val.y = Number(val.y.toFixed())
 			val.width = Number(val.width.toFixed())
 			val.height = Number(val.height.toFixed())
 			val.count = 0
+			val.id = val.pageNum + '-' + val.index
 			if(state.config.contents.length){
 				let infoItem = state.config.contents.find(i => i.type === 0)
 				if(infoItem){
@@ -124,11 +125,12 @@ export default {
 		},
 		// 设置客观题区域的配置数据
 		setObjectiveConfig(state,val){
-			val.index = state.config.contents.filter(i => i.pageNum === val.pageNum && !i.isFix).length + ''
+			val.index = state.config.contents.filter(i => i.pageNum === val.pageNum).length + 1
 			val.x = Number(val.x.toFixed())
 			val.y = Number(val.y.toFixed())
 			val.width = Number(val.width.toFixed())
 			val.height = Number(val.height.toFixed())
+			val.id = val.pageNum + '-' + val.index
 			if(state.config.contents.length){
 				let infoItem = state.config.contents.find(i => i.type === 1)
 				if(infoItem){
@@ -143,15 +145,12 @@ export default {
 		},
 		setSubjectiveConfig(state,val){
 			console.log(val.id,val.pageNum)
-			if(val.isFix){
-				val.index = null
-			}else{
-				val.index = state.config.contents.filter(i => i.pageNum === val.pageNum && !i.isFix).length + ''
-			}
+			val.index = state.config.contents.filter(i => i.pageNum === val.pageNum).length + 1
 			val.x = Number(val.x.toFixed())
 			val.y = Number(val.y.toFixed())
 			val.width = Number(val.width.toFixed())
 			val.height = Number(val.height.toFixed())
+			val.id = val.pageNum + '-' + val.index
 			val.count = 0
 			if(state.config.contents.length){
 				let infoItem = state.config.contents.find(i => i.id === val.id)

+ 2 - 3
TEAMModelOS/ClientApp/src/view/answersheet/BaseEditor.vue

@@ -133,7 +133,6 @@
 					"width": INFO_W,
 					"height": height,
 					"pageNum": pageNum,
-					"id":this.curItemId || '',
 					"isFix":isFix || false
 				} 
 				this.$store.commit('setSubjectiveConfig', itemConfig)
@@ -256,7 +255,7 @@
 								this.$store.commit("addPage");
 								let heightArr = []
 								this.myEditor.config.height = leftHeight + 20;
-								this.setSubjectiveConfig(curEditorY,leftHeight + 20,curItemWhichPage)
+								this.setSubjectiveConfig(curEditorY,leftHeight + 20,curItemWhichPage,true)
 								heightArr.push(leftHeight)
 								// 如果渲染的客观题高度在这个区间 才需要在下一页添加补充作答区域 其余全部按照正常 跨页处理不需要补充作答区域
 								let fixCount = Math.ceil(fixHeight / SVG_BORDER_PROP.height)
@@ -400,7 +399,7 @@
 								this.$store.commit("addPage");
 								let heightArr = []
 								this.myEditor.config.height = leftHeight + 20;
-								this.setSubjectiveConfig(curEditorY,leftHeight + 20,curItemWhichPage)
+								this.setSubjectiveConfig(curEditorY,leftHeight + 20,curItemWhichPage,true)
 								heightArr.push(leftHeight)
 								console.log(fixHeight)
 								// 如果渲染的客观题高度在这个区间 才需要在下一页添加补充作答区域 其余全部按照正常 跨页处理不需要补充作答区域

+ 31 - 10
TEAMModelOS/ClientApp/src/view/settings/BaseApplyForm.vue

@@ -30,7 +30,7 @@
 					</Select>
 					<!-- 如果国际站选择的地区是台湾则要显示台湾的城市和区选择 -->
 					<template v-if="isShowTw">
-						<Select v-model="curTwCityIndex" filterable :placeholder="$t('settings.applyForm.place6')" @on-change="onTwCitySelect" style="margin: 10px 0;">
+						<Select v-model="curTwCityIndex" filterable :placeholder="$t('settings.applyForm.place6')" @on-change="onTwCitySelect" style="margin: 0 10px;">
 							<Option v-for="(city,index) in twCityArr" :value="index" :key="index" >{{ city.city }}</Option>
 						</Select>
 						<Select v-model="curTwAreaIndex" filterable :placeholder="$t('settings.applyForm.place6')">
@@ -71,7 +71,9 @@
 
 <script>
 	import countries from '@/static/countries.js'
+	import enCountries from '@/static/countryCodeData.js'
 	import twCitys from '@/static/twJson.js'
+	import twTCitys from '@/static/twJsonT.js'
 	export default {
 		data(vm) {
 			return {
@@ -136,16 +138,37 @@
 			}
 		},
 		created() {
-			this.countryArr = countries
-			this.twCityArr = twCitys
+			let curLocal = localStorage.getItem('local')
+			let attr = 'CountryEn'
+			if (curLocal.includes('cn') || curLocal.includes('CN')) {
+			    this.countryArr = countries
+				this.twCityArr = twCitys
+			} else if (curLocal.includes('tw') || curLocal.includes('TW')) {
+				this.twCityArr = twTCitys
+				for (const key in enCountries) {
+				    this.countryArr.push(
+				        {
+				            cn: enCountries[key].CountryTw,
+				        }
+				    )
+				}
+			}else{
+				this.twCityArr = twTCitys
+				for (const key in enCountries) {
+				    this.countryArr.push(
+				        {
+				            cn: enCountries[key].CountryEn,
+				        }
+				    )
+				}
+			}
+			
 		},
 		methods: {
 			// 提交建立学校申请
 			onSubmit() {
 				this.$refs.applyForm.validate((valid) => {
 					if (valid) {
-						console.log(this.curCountry)
-						console.log(this.isChinaSite)
 						let hasFullAddress = false
 						let fullAddress = ''
 						if(this.isChinaSite){
@@ -153,11 +176,9 @@
 							hasFullAddress = pickResult.province && pickResult.city && pickResult.area
 							fullAddress = hasFullAddress ? (pickResult.province + pickResult.city + pickResult.area + this.applyForm.address) : ''
 						}else{
-							console.log(this.curCountry)
 							hasFullAddress = this.curCountry
-							fullAddress = this.isShowTw ? (this.curCountry + this.curTwCity.city + this.curTwCity.area[this.curTwAreaIndex] + this.applyForm.address) : (this.curCountry + this.applyForm.address)
+							fullAddress = this.isShowTw ? (this.curCountry + this.curTwCity.city + this.curTwCity.areas[this.curTwAreaIndex].area + this.applyForm.address) : (this.curCountry + this.applyForm.address)
 						}
-						console.log(fullAddress)
 						if(hasFullAddress){
 							this.isBtnLoading = true
 							let formInfo = this.applyForm
@@ -206,7 +227,7 @@
 			},
 			/* 国家选择 */
 			onCountrySelect(val){
-				if(val === '台湾' || val === '灣'){
+				if(val === '台湾' || val === '灣'){
 					this.isShowTw = true
 					this.curTwCity = this.twCityArr[0]
 				}else{
@@ -232,7 +253,7 @@
 		padding: 50px 20px 0 20px;
 		
 		.country-select{
-			width: 200px;
+			display: flex;
 			margin: 10px 0;
 		}
 		

+ 2 - 2
TEAMModelOS/ClientApp/src/view/settings/SchoolMgmt.vue

@@ -115,9 +115,9 @@
 			<Button @click="onChangeSchool">{{ $t('evaluation.confirm')}}</Button>
 		</Modal>
 
-		<Modal v-model="applyModal" class-name="go-school-modal" footer-hide width="500">
+		<Modal v-model="applyModal" class-name="go-school-modal" footer-hide width="650">
 			<span class="apply-title">{{ $t('settings.applyForm.title')}}</span>
-			<BaseApplyForm @applySuc="applyModal = false"></BaseApplyForm>
+			<BaseApplyForm @applySuc="applyModal = false" v-if="applyModal"></BaseApplyForm>
 		</Modal>
 
 	</div>