import{d as C,K as E,O as J,k as g,v as K,r as b,o as w,c as k,a,b as e,u as t,y as _,z as l,L as G,t as L,B as $,a5 as z,G as A,H}from"./vue.1703796278973.js";import{F as h,a1 as O,k as T,r as Y,I as Q,aG as W,K as X,av as Z,aw as ee,aB as te}from"./index.17037962789732.js";import"./index.1703796278973308.js";import"./index.170379627897334.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897318.js";import"./index.170379627897315.js";import"./index.170379627897314.js";import"./index.1703796278973301.js";import"./default.1703796278973.js";import"./index.170379627897310.js";import"./index.17037962789737.js";import{a as oe,o as ae}from"./comm.1703796278973.js";import{_ as x}from"./CertificateFile.vue_vue_type_script_setup_true_name_CertificateFile_lang.1703796278973.js";import{s as se,u as ne,q as le}from"./certificate.1703796278973.js";import{_ as re}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.1703796278973303.js";import"./index.170379627897329.js";import"./index.170379627897330.js";import"./system.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897333.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const ie=p=>(A("data-v-2c831e25"),p=p(),H(),p),ue=["src"],ce=ie(()=>l("div",{class:"doc"},[l("h1",null,"1. 概述"),l("div",null," 证书由受信任的数字证书颁发机构CA，在验证服务器身份后颁发，具有服务器身份验证和数据传输加密功能，保障设备与平台间的数据传输安全。配置后可被网络组件引用。 "),l("h1",null,"2. 配置说明"),l("h2",null,"1、证书文件"),l("div",null," 您可以使用文本编辑工具打开PEM格式的证书文件，复制其中的内容并粘贴到该文本框，或者单击该文本框下的上传，并选择存储在本地计算机的证书文件，将文件内容上传到文本框。 "),l("h2",null,"2、证书私钥"),l("div",null," 填写证书私钥内容的PEM编码。 您可以使用文本编辑工具打开KEY格式的证书私钥文件，复制其中的内容并粘贴到该文本框，或者单击该文本框下的上传并选择存储在本地计算机的证书私钥文件，将文件内容上传到文本框。 ")],-1)),pe=C({name:"CertificateDetail"}),me=C({...pe,setup(p){const j=E(),v=J(),V=v.query.view,d=v.params.id,I=h.useForm;g(!1);const i=g(!1),s=g({type:"common",name:"",configs:{cert:"",key:""},description:""}),{resetFields:_e,validate:q,validateInfos:m}=I(s,K({type:[{required:!0,message:"请选择证书标准",trigger:"blur"}],name:[{required:!0,message:"请输入证书名称",trigger:"blur"},{max:64,message:"最多可输入64个字符"}],"configs.cert":[{required:!0,message:"请输入或上传文件",trigger:"blur"}],"configs.key":[{required:!0,message:"请输入或上传文件",trigger:"blur"}],description:[{max:200,message:"最多可输入200个字符"}]})),F=()=>{q().then(async c=>{const o=z(s.value);i.value=!0;const r=d===":id"?await se(o).catch(()=>{}):await ne({...o,id:d}).catch(()=>{});(r==null?void 0:r.status)===200&&(ae("操作成功","success"),j.push("/iot/link/certificate")),i.value=!1}).catch(c=>{i.value=!1})};return(async c=>{if(c!==":id"){i.value=!0;const o=await le(c);if(o.success){const r=o.result,f=r.type.value;s.value={...r,type:f}}i.value=!1}})(d),(c,o)=>{const r=O,f=T,u=Y,B=Q,P=W,U=X,M=h,y=Z,N=ee,R=te,S=b("FullPage"),D=b("page-container");return w(),k(D,null,{default:a(()=>[e(S,null,{default:a(()=>[e(R,null,{default:a(()=>[e(N,{gutter:[24,24],style:{padding:"24px"}},{default:a(()=>[e(y,{span:12},{default:a(()=>[e(M,{class:"form",layout:"vertical",model:t(s),name:"basic","label-col":{span:8},"wrapper-col":{span:24},autocomplete:"off"},{default:a(()=>[e(u,_({label:"证书标准"},t(m).type),{default:a(()=>[e(f,{value:t(s).type,"onUpdate:value":o[0]||(o[0]=n=>t(s).type=n)},{default:a(()=>[e(r,{class:"form-radio-button",value:"common"},{default:a(()=>[l("img",{src:t(oe)("/certificate.png")},null,8,ue)]),_:1})]),_:1},8,["value"])]),_:1},16),e(u,_({label:"证书名称"},t(m).name),{default:a(()=>[e(B,{placeholder:"请输入证书名称",value:t(s).name,"onUpdate:value":o[1]||(o[1]=n=>t(s).name=n)},null,8,["value"])]),_:1},16),e(u,_({label:"证书文件"},t(m)["configs.cert"]),{default:a(()=>[e(x,{name:"cert",modelValue:t(s).configs.cert,"onUpdate:modelValue":o[2]||(o[2]=n=>t(s).configs.cert=n),placeholder:"请输入证书文件"},null,8,["modelValue"])]),_:1},16),e(u,_({label:"证书私钥"},t(m)["configs.key"]),{default:a(()=>[e(x,{name:"key",modelValue:t(s).configs.key,"onUpdate:modelValue":o[3]||(o[3]=n=>t(s).configs.key=n),placeholder:"请输入证书私钥"},null,8,["modelValue"])]),_:1},16),e(u,{label:"说明",name:"description"},{default:a(()=>[e(P,{placeholder:"请输入说明",value:t(s).description,"onUpdate:value":o[4]||(o[4]=n=>t(s).description=n),maxlength:200,rows:3,showCount:""},null,8,["value"])]),_:1}),e(u,null,{default:a(()=>[t(V)==="false"?(w(),k(U,{key:0,class:"form-submit","html-type":"submit",type:"primary",onClick:G(F,["prevent"]),loading:t(i)},{default:a(()=>[L("保存")]),_:1},8,["onClick","loading"])):$("",!0)]),_:1})]),_:1},8,["model"])]),_:1}),e(y,{span:12},{default:a(()=>[ce]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}}});const Oe=re(me,[["__scopeId","data-v-2c831e25"]]);export{Oe as default};
