2026-04-03 11:21:55 +08:00

2 lines
5.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{d as B,r as g,l as D,X as U,k as s,h as f,c as w,e as l,w as n,a as t,t as u,u as i,J as A,m as k,i as b,B as V,F as P,af as R,ag as $,G as K,D as q,aC as O,H as Y,L as j,E as G,M as J,p as L,g as X}from"./index-c42d56a0.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import{X as H,Y as Z}from"./sys-53bca014.js";import{_ as z}from"./_plugin-vue_export-helper-c27b6911.js";const _=c=>(L("data-v-cbbb5691"),c=c(),X(),c),Q={class:"main-container"},W={class:"flex justify-between items-center"},ee={class:"text-page-title"},te=_(()=>t("div",{class:"text-sm text-gray-400 mt-[10px] leading-none"},"选择地图服务提供商",-1)),ae={class:"flex items-center"},oe={class:"flex items-center"},le=_(()=>t("div",{class:"text-sm text-gray-400 mt-[10px] leading-none"},"天地图服务器端API密钥用于后端地理编码等服务请求从业务服务器发起不支持前端地图瓦片加载与 JS API 渲染。",-1)),se=_(()=>t("div",{class:"text-sm text-gray-400 mt-[10px] leading-none"},"使用场景:如地理编码、逆地理编码、坐标转换、批量 POI 查询等。",-1)),ne={class:"flex items-center"},ie=_(()=>t("div",{class:"text-sm text-gray-400 mt-[10px] leading-none"},"天地图浏览器端API密钥用于前端加载地图不可用于后端接口鉴权。",-1)),de=_(()=>t("div",{class:"text-sm text-gray-400 mt-[10px] leading-none"},"使用场景:展示地图瓦片、实现地图交互(缩放、拖拽、图层切换、标注、可视化展示、地图选位置等)。",-1)),re={class:"ml-[10px]"},pe={class:"ml-[150px] text-sm text-gray-400"},me={class:"fixed-footer-wrap"},ue={class:"fixed-footer"},_e=B({__name:"map",setup(c){const d=g(!0),x=g(),a=D({map_type:"tencent",key:"",tianditu_map_key:"",tianditu_map_web_key:"",is_open:0,valid_time:0}),h=U(()=>({valid_time:[{required:!0,trigger:"blur",validator:(r,e,p)=>{e===""?p(new Error(s("validTimePlaceholder"))):isNaN(e)||!/^\d{0,10}$/.test(e)?p(new Error(s("validTimeFormatTips"))):e<5?p(new Error(s("validTimeNotZeroTips"))):p()}}]}));(async()=>{d.value=!0;const r=await(await H()).data;Object.assign(a,r),d.value=!1})();const E=async r=>{d.value||!r||await r.validate(async e=>{e&&(d.value=!0,Z(a).then(()=>{d.value=!1}).catch(()=>{d.value=!1}))})},C=()=>{window.open("https://www.kancloud.cn/niucloud/niucloud-admin-develop/3214217")},y=r=>{window.open(r)};return(r,e)=>{const p=R,I=$,m=K,v=q,T=O,F=Y,S=j,M=G,N=J;return f(),w("div",Q,[l(S,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[t("div",W,[t("span",ee,u(i(s)("mapSetting")),1)]),A((f(),k(F,{class:"page-form mt-[20px]",model:a,rules:i(h),"label-width":"150px",ref_key:"formRef",ref:x},{default:n(()=>[l(m,{label:"地图类型",prop:"map_type"},{default:n(()=>[t("div",null,[l(I,{modelValue:a.map_type,"onUpdate:modelValue":e[0]||(e[0]=o=>a.map_type=o)},{default:n(()=>[l(p,{label:"tianditu"},{default:n(()=>[b("天地图")]),_:1}),l(p,{label:"tencent"},{default:n(()=>[b("腾讯地图")]),_:1})]),_:1},8,["modelValue"]),te])]),_:1}),a.map_type==="tencent"?(f(),k(m,{key:0,label:i(s)("mapKey"),prop:"key"},{default:n(()=>[t("div",null,[t("div",ae,[l(v,{modelValue:a.key,"onUpdate:modelValue":e[1]||(e[1]=o=>a.key=o),modelModifiers:{trim:!0},class:"input-width",clearable:""},null,8,["modelValue"]),t("span",{class:"ml-2 cursor-pointer tutorial-btn",onClick:C},u(i(s)("clickTutorial")),1),t("span",{class:"ml-2 cursor-pointer secret-btn",onClick:e[2]||(e[2]=o=>y("https://lbs.qq.com/dev/console/key/manage"))},u(i(s)("clickSecretKey")),1)])])]),_:1},8,["label"])):V("",!0),a.map_type==="tianditu"?(f(),w(P,{key:1},[l(m,{label:"天地图服务端KEY",prop:"tianditu_map_key"},{default:n(()=>[t("div",null,[t("div",oe,[l(v,{modelValue:a.tianditu_map_key,"onUpdate:modelValue":e[3]||(e[3]=o=>a.tianditu_map_key=o),modelModifiers:{trim:!0},class:"input-width",clearable:""},null,8,["modelValue"]),t("span",{class:"ml-2 cursor-pointer secret-btn",onClick:e[4]||(e[4]=o=>y("https://cloudcenter.tianditu.gov.cn/center/development/myApp"))},"获取密钥")]),le,se])]),_:1}),l(m,{label:"天地图浏览器端KEY",prop:"tianditu_map_web_key"},{default:n(()=>[t("div",null,[t("div",ne,[l(v,{modelValue:a.tianditu_map_web_key,"onUpdate:modelValue":e[5]||(e[5]=o=>a.tianditu_map_web_key=o),modelModifiers:{trim:!0},class:"input-width",clearable:""},null,8,["modelValue"]),t("span",{class:"ml-2 cursor-pointer secret-btn",onClick:e[6]||(e[6]=o=>y("https://cloudcenter.tianditu.gov.cn/center/development/myApp"))},"获取密钥")]),ie,de])]),_:1})],64)):V("",!0),l(m,{label:i(s)("isOpen"),prop:"is_open"},{default:n(()=>[l(T,{modelValue:a.is_open,"onUpdate:modelValue":e[7]||(e[7]=o=>a.is_open=o),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1},8,["label"]),l(m,{label:i(s)("validTime"),prop:"valid_time"},{default:n(()=>[l(v,{modelValue:a.valid_time,"onUpdate:modelValue":e[8]||(e[8]=o=>a.valid_time=o),modelModifiers:{trim:!0},class:"!w-[120px]"},null,8,["modelValue"]),t("span",re,u(i(s)("minutes")),1)]),_:1},8,["label"]),t("div",pe,u(i(s)("validTimeTips")),1)]),_:1},8,["model","rules"])),[[N,d.value]])]),_:1}),t("div",me,[t("div",ue,[l(M,{type:"primary",loading:d.value,onClick:e[9]||(e[9]=o=>E(x.value))},{default:n(()=>[b(u(i(s)("save")),1)]),_:1},8,["loading"])])])])}}});const Ie=z(_e,[["__scopeId","data-v-cbbb5691"]]);export{Ie as default};