2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
var v=(m,c,a)=>new Promise((_,o)=>{var r=t=>{try{i(a.next(t))}catch(s){o(s)}},e=t=>{try{i(a.throw(t))}catch(s){o(s)}},i=t=>t.done?_(t.value):Promise.resolve(t.value).then(r,e);i((a=a.apply(m,c)).next())});import{d as j,j as d,aL as h,b8 as I,a1 as N,aE as R,r as u,o as T,D as b,w as p,b as l,u as k,e as B,Q as E,n as U,t as z,U as x,ba as A,ad as D,R as K,a9 as M,h as V}from"./index-4ec2ce15.js";import{i as F}from"./icon-42fa39e7.js";import{u as J,E as L,P as O}from"./chartEditStore-bfc6c223.js";import{u as H}from"./project.api-0931840b.js";import{u as Q}from"./useSync.hook-dcdbd18a.js";import"./plugin-ae137233.js";import"./chartLayoutStore-810503fe.js";import"./index-96c3a075.js";import"./SettingItem-35031211.js";/* empty css */import"./SettingItemBox-f60eaa4e.js";import"./CollapseItem.vue_vue_type_script_setup_true_lang-77b092a0.js";import"./index.esm.min-2eecdcbd.js";import"./fileTypeEnum-21359a08.js";const $={class:"title"},q=j({__name:"index",setup(m){const c=J(),{dataSyncUpdate:a}=Q(),{FishIcon:_}=F.ionicons5,o=d(!1),r=d(null),e=d(h());I(()=>{e.value=c.getProjectInfo.projectName||""});const i=N(()=>{e.value=e.value.replace(/\s/g,"");const n=e.value.length?e.value:"新项目";return R(`工作空间-${n}`),c.setEditCanvasConfig(L.PROJECT_NAME,n),n}),t=()=>{o.value=!0,D(()=>{r.value&&r.value.focus()})},s=()=>v(this,null,function*(){o.value=!1,c.setProjectInfo(O.PROJECT_NAME,e.value||"");const n=yield H({id:h(),projectName:e.value});n&&n.code===K.SUCCESS?a():M()});return(n,f)=>{const y=u("n-icon"),C=u("n-button"),w=u("n-text"),S=u("n-input"),g=u("n-space");return T(),b(g,null,{default:p(()=>[l(y,{size:"20",depth:3},{default:p(()=>[l(k(_))]),_:1}),l(w,{onClick:t},{default:p(()=>[B(" 工作空间 - "),E(l(C,{secondary:"",size:"tiny"},{default:p(()=>[U("span",$,z(i.value),1)]),_:1},512),[[x,!o.value]])]),_:1}),E(l(S,{ref_key:"inputInstRef",ref:r,size:"small",type:"text",maxlength:"16","show-count":"",placeholder:"请输入项目名称",value:e.value,"onUpdate:value":f[0]||(f[0]=P=>e.value=P),valueModifiers:{trim:!0},onKeyup:A(s,["enter"]),onBlur:s},null,8,["value","onKeyup"]),[[x,o.value]])]),_:1})}}});const le=V(q,[["__scopeId","data-v-4af849d3"]]);export{le as default};
|