2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
|
import{d as M,O,f as j,r as _,N as e,v as G,y as Z,h as c,c as h,a as s,u as a,t as i,e as r,w as n,I as f,i as P,B as x,F as w,G as F,a8 as K,a4 as W,W as X,X as Y,E as H,as as J,aF as Q,Y as ee,$ as le,a0 as ae}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as te}from"./index-742b412a.js";import"./el-form-item-4ed993c7.js";import{a as oe,b as re,c as se,e as ne,d as de}from"./tools-123d2a10.js";import{a2 as ue}from"./sys-8ead7f22.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";/* empty css */import"./attachment-c69dd9fd.js";/* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */const pe={class:"main-container mb-80"},ie={class:"detail-head !mb-[10px]"},ce=s("span",{class:"iconfont iconxiangzuojiantou !text-xs"},null,-1),me={class:"ml-[1px]"},ve=s("span",{class:"adorn"},"|",-1),_e={class:"right"},he={class:"text-[12px] text-[#a9a9a9] leading-normal mt-[5px]"},ge={class:"text-[12px] text-[#a9a9a9] leading-normal mt-[5px]"},ye={class:"text-[12px] text-[#a9a9a9] leading-normal"},fe={class:"text-[12px] text-[#a9a9a9] leading-normal mt-[5px]"},xe={class:"text-[12px] text-[#a9a9a9] leading-normal mt-[5px]"},be={class:"text-[12px] text-[#a9a9a9] leading-normal mt-[5px]"},Ve={class:"text-[12px] text-[#a9a9a9] leading-normal"},ke={key:0,class:"fixed-footer-wrap"},Pe={class:"fixed-footer"},tl=M({__name:"edit",setup(we){const v=O(),b=j(),B=v.meta.title,t=_({title:"",icon:"",key:"",desc:"",author:"",version:"",cover:"",type:"",support_app:"",support_type:1}),E=_([]),m=_(!1),A=_(),D=(p,l,d)=>l!==""?/^[a-zA-Z][a-zA-Z0-9_]*$/.test(l)?d():d(new Error(e("keyPlaceholderErr"))):d(new Error(e("keyPlaceholder"))),T=(p,l,d)=>l!==""?/^([0-9]\d|[0-9])(\.([0-9]){1}){2}$/.test(l)?d():d(new Error(e("versionPlaceholderErr"))):d(new Error(e("versionPlaceholder"))),L=_({title:[{required:!0,message:e("titlePlaceholder"),trigger:"blur"}],icon:[{required:!0,message:e("iconPlaceholder"),trigger:"change"}],key:[{required:!0,validator:D,trigger:"blur"}],author:[{required:!0,message:e("authorPlaceholder"),trigger:"blur"}],version:[{required:!0,validator:T,trigger:"blur"}],cover:[{required:!0,message:e("coverPlaceholder"),trigger:"change"}],type:[{required:!0,message:e("typePlaceholder"),trigger:"change"}],support_app:[{required:!0,message:e("typePlaceholder"),trigger:"change"}]});G(async()=>{const p=await oe();E.value=p.data,v.query.key&&N(v.query.key)});const q=()=>{t.value.support_app=""},N=p=>{m.value=!0,re(p).then(l=>{t.value=Object.assign(t.value,l.data),m.value=!1}).catch(()=>{m.value=!1})},C=_([]);(async()=>{const{data:p}=await ue();C.value=p})();const $=p=>{se(p).then(l=>{K.alert(l.data?e("warningText"):e("successText"),e("warning"),{confirmButtonText:e("confirm"),callback:d=>{console.log(d)}})})},I=async p=>{await p.validate(async l=>{if(l){const d=v.query.key?ne:de;m.value=!0,d(t.value.key,t.value).then(u=>{m.value=!1,W({message:e("onSaveSuccessText"),type:"success"}),setTimeout(()=>{window.addonActiveName="pluginList",b.push({path:"/tools/addon"})},650)}).catch(()=>{m.value=!1})}})};return(p,l)=>{const d=X,u=Y,U=te,V=H,g=J,k=Q,S=ee,R=le,z=ae;return Z((c(),h("div",pe,[s("div",ie,[s("div",{class:"left",onClick:l[0]||(l[0]=o=>a(b).push({path:"/tools/addon"}))},[ce,s("span",me,i(a(e)("returnToPreviousPage")),1)]),ve,s("span",_e,i(a(B)),1)]),r(R,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[r(S,{model:t.value,"label-width":"90px",r
|