diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1e3cd90 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# 确保所有文本文件使用 UTF-8 编码 +* text=auto eol=lf +*.vue text eol=lf charset=utf-8 +*.ts text eol=lf charset=utf-8 +*.js text eol=lf charset=utf-8 +*.json text eol=lf charset=utf-8 + diff --git a/src/api/recruit/recruitstudentsignup.ts b/src/api/recruit/recruitstudentsignup.ts index d3a4afa..42e99e5 100644 --- a/src/api/recruit/recruitstudentsignup.ts +++ b/src/api/recruit/recruitstudentsignup.ts @@ -458,6 +458,7 @@ export const batchPushAll = (obj: any) => { */ export const BMPGL = (ak: string) => { return new Promise(function (resolve, reject) { + // @ts-ignore window.init = function () { // eslint-disable-next-line // resolve(BMapGL); @@ -470,6 +471,45 @@ export const BMPGL = (ak: string) => { }); }; +/** + * 天地图 + * @param tk 天地图token + */ +export const loadTiandituMap = (tk: string) => { + return new Promise(function (resolve, reject) { + // @ts-ignore + // 如果天地图API已经加载,直接返回 + if (window.T) { + // @ts-ignore + resolve(window.T); + return; + } + + // 检查是否已经有加载中的脚本 + const existingScript = document.querySelector('script[src*="api.tianditu.gov.cn"]'); + if (existingScript) { + // 如果脚本正在加载中,等待加载完成 + existingScript.addEventListener('load', () => { + // @ts-ignore + resolve(window.T); + }); + existingScript.addEventListener('error', reject); + return; + } + + // 加载天地图主库 + const script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${tk}`; + script.onload = () => { + // @ts-ignore + resolve(window.T); + }; + script.onerror = reject; + document.head.appendChild(script); + }); +}; + /** * 宿舍申请分析 * @param obj diff --git a/src/config/map.ts b/src/config/map.ts new file mode 100644 index 0000000..92c9ac7 --- /dev/null +++ b/src/config/map.ts @@ -0,0 +1,40 @@ +/** + * 地图配置文件 + * 统一管理地图相关的配置信息 + */ + +/** + * 天地图Token + * 请到天地图开放平台申请:https://console.tianditu.gov.cn/ + * 申请后请将下方的token替换为您自己的token + */ +export const TIANDITU_TOKEN = 'd584b11f3c0d801105df2f415a2d3530' + +/** + * 地理编码服务配置 + * 使用OpenStreetMap Nominatim服务(完全免费) + */ +export const GEOCODING_SERVICE = 'nominatim' // 使用Nominatim服务 + +/** + * 天地图API版本 + */ +export const TIANDITU_API_VERSION = '4.0' + +/** + * 天地图地理编码服务地址 + */ +export const TIANDITU_GEOCODE_URL = 'https://api.tianditu.gov.cn/geocoder' + +/** + * 默认地图中心点(可根据实际情况修改) + */ +export const DEFAULT_MAP_CENTER = { + lng: 116.397428, + lat: 39.90923 +} + +/** + * 默认地图缩放级别 + */ +export const DEFAULT_MAP_ZOOM = 13 diff --git a/src/views/recruit/recruitstudentsignup/detaiform.vue b/src/views/recruit/recruitstudentsignup/detaiform.vue index db296f9..29a5e0d 100644 --- a/src/views/recruit/recruitstudentsignup/detaiform.vue +++ b/src/views/recruit/recruitstudentsignup/detaiform.vue @@ -590,7 +590,7 @@ @@ -612,7 +612,7 @@ import { list as listByGroupId } from '/@/api/recruit/recruitstudentschool' import { getDeptList } from "/@/api/basic/basicclass" import { getList } from "/@/api/recruit/recruitstudentplangroup" import { listByEdu } from "/@/api/recruit/recruitstudentplan" -import { getDictsByTypes } from "/@/api/admin/dict" +import { getDicts, getDictsByTypes } from "/@/api/admin/dict" import { useDict } from '/@/hooks/dict' import { areaList, areaSonList } from "/@/api/recruit/recruitstudentschool" import { list as scoreList } from "/@/api/recruit/recruitstudentplancorrectscoreconfig" @@ -832,6 +832,9 @@ const init = (id: string | null, typeParam: number) => { isShow.value = true nextTick(() => { dataFormRef.value?.resetFields() + getDicts('finance_student_source').then((res: any) => { + eduList.value = res.data || [] + }) if (dataForm.id) { areaPList.value = [] areaCList.value = [] diff --git a/src/views/recruit/recruitstudentsignup/dormFW.vue b/src/views/recruit/recruitstudentsignup/dormFW.vue index 9cb4199..413d7fd 100644 --- a/src/views/recruit/recruitstudentsignup/dormFW.vue +++ b/src/views/recruit/recruitstudentsignup/dormFW.vue @@ -4,22 +4,19 @@ append-to-body :close-on-click-modal="false" v-model="visible" - width="800"> + width="90%">