import{e,a9 as t,cv as a,x as i,cy as s,r as n,h as d,w as l,z as o,o as r,i as u,a as c,j as p,t as m,s as _,m as f,cx as h,a0 as g,cz as b}from"./index-WeUkftbp.js";import{d as x}from"./index.BcUDVLb2.js";import{g as y}from"./index.NTbA_2SX.js";import{d as j}from"./dropDown.BqJIy245.js";import{b as v}from"./index.Bs5RY4bm.js";import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.cBITQXNK.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-row.DLutFlIQ.js";import"./uni-popup.CI1Fmu1z.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BVw2wyB9.js";/* empty css                                                              */const T=w({__name:"details",setup(w){const T=e({rightIcon:[{type:1,icon:"icon-gengduo1",types:"icon"}],default:{},content:"",treeData:[],id:null,tab:"",pid:"",defaultTitle:"",isShowTitle:!1}),$=e([{name:"编辑",id:1,icon:"icon-gongzuohuibao-bianji"},{name:"移动至",id:2,icon:"icon-jishiben-yidongzhi"},{name:"删除",id:3,icon:"icon-shanchu1"}]);t((e=>{e.id&&(T.id=e.id,T.tab=e.tab,T.pid=e.pid,D(e.id),k())}));const D=e=>{a(e).then((e=>{T.default=e.data||{},e.data.content&&(T.content=e.data.content.replace(/<img/gi,'<img style="max-width:100%;height:auto" ')),e.data.parent?T.defaultTitle=e.data.parent.name:T.defaultTitle="记事本",T.isShowTitle=!0})).catch((e=>{i.error(e.message)}))},k=()=>{s().then((e=>{T.treeData=e.data.tree||[]})).catch((e=>{i.error(e.message)}))},z=n(null),I=e=>{z.value.openDropdown()},S=n(null),C=e=>{if(2===e.id)S.value.show();else if(3===e.id)_("确定要删除这条内容吗").then((()=>{M(T.default.id,T.default.pid)})).catch((()=>{}));else{let e="";e="newes"===T.tab?`/pages/users/memorandum/create?tab=${T.tab}&pid=&id=${T.id}`:`/pages/users/memorandum/create?tab=${T.tab}&pid=${T.default.pid}&id=${T.id}`,f(e)}},H=()=>{let e="";e=`/pages/users/memorandum/create?tab=${T.tab}&pid=&id=${T.id}`,f(e)},K=e=>{const t={title:T.default.title,content:T.default.content,pid:e[0]};L(T.default.id,t)},L=(e,t)=>{h(e,t).then((e=>{i.success("移动成功"),g("/pages/users/memorandum/index")})).catch((e=>{i.error(e.message)}))},M=(e,t)=>{b(e).then((e=>{i.success(e.message);let a="";a="newes"===T.tab?`/pages/users/memorandum/index?tab=${T.tab}&id=`:`/pages/users/memorandum/index?tab=${T.tab}&id=${t}`,g(a)})).catch((e=>{i.error(e.message)}))};return(e,t)=>{const a=o;return r(),d(a,{class:"content"},{default:l((()=>[u(a,{class:"cr-position-header"},{default:l((()=>[u(a,{class:"status_bar"}),u(c(x),{"is-right":!0,"default-title":T.defaultTitle,"is-show-title":T.isShowTitle,"right-data":T.rightIcon,onHandleNarItem:I},null,8,["default-title","is-show-title","right-data"])])),_:1}),u(a,{class:"details-content plr10"},{default:l((()=>[u(a,{class:"details-title"},{default:l((()=>[p(m(T.default.title),1)])),_:1}),u(a,{class:"details",onClick:H},{default:l((()=>[u(a,{innerHTML:T.content},null,8,["innerHTML"])])),_:1})])),_:1}),u(j,{ref_key:"dropDownRef",ref:z,"list-data":$,onBtnClick:C},null,8,["list-data"]),u(v,{ref_key:"treePickerRef",ref:S,multiple:!1,onSelectChange:K,title:"移动至",localdata:T.treeData,valueKey:"id",textKey:"name",childrenKey:"children",border:!0},null,8,["localdata"]),u(y)])),_:1})}}},[["__scopeId","data-v-0df30140"]]);export{T as default};
