import{a_ as L,Z as w,c9 as D,a8 as I,V as P}from"./index-Cy4uayzW.js";import{U as n,a2 as H,ad as N,af as r,k as l,a6 as x,a4 as J,a5 as V,G as S,d as R,f as y,n as T}from"./vue-vendor-CxLCUzY4.js";import{B as F}from"./index-zKZnG1QC.js";import"./index-BN26Feep.js";import $ from"./JCodeEditor-U9QIstNN.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useForm-DfoT2G6J.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./JAreaLinkage-CTMEfTuh.js";import"./EasyCronInput-CZdChTcP.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */var z=Object.defineProperty,E=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,M=(e,t,o)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,k=(e,t)=>{for(var o in t||(t={}))Q.call(t,o)&&M(e,o,t[o]);if(E)for(var o of E(t))U.call(t,o)&&M(e,o,t[o]);return e},G=(e,t,o)=>new Promise((p,d)=>{var f=i=>{try{c(o.next(i))}catch(m){d(m)}},h=i=>{try{c(o.throw(i))}catch(m){d(m)}},c=i=>i.done?p(i.value):Promise.resolve(i.value).then(f,h);c((o=o.apply(e,t)).next())});const j=w(),O="enhance_",K=L({id:"online-cgform-enhance",state:()=>({enhanceJs:{}}),getters:{},actions:{getEnhanceJs(e){return this.enhanceJs[e]=j.get(O+e),this.enhanceJs[e]},addEnhanceJs(e){this.enhanceJs[e.code]?this.enhanceJs[e.code].push(k({},e)):this.enhanceJs[e.code]=[k({},e)];let t=this.enhanceJs[e.code];for(;t.length>16;)t.shift();j.set(O+e.code,t)}}}),W=R({name:"EnhanceJsHistory",components:{BasicModal:F,JCodeEditor:$},setup(){const e=K(),t=y(),o=y(!1),p=y([]),d=y(""),f=y(0),[h,{closeModal:c}]=I(a=>G(this,null,function*(){i(a.code,a.type)}));function i(a,C){d.value="",p.value=[];let _=e.getEnhanceJs(a),s=[],u=0;for(let g of _)g.type===C&&(u++,s.push(Object.assign({},g,{index:u})));s&&s.length>0&&s.sort((g,B)=>B.date-g.date),p.value=[...s],T(()=>v(s[0]))}function m(){c()}function b(a){return P(a,"yyyy-MM-DD HH:mm:ss")}function v(a){f.value=a.index,t.value.setValue(a.str)}return{codeEditorRef:t,fullCode:v,registerModal:h,getFormatDate:b,onCancel:m,confirmLoading:o,dataList:p,jsStr:d,activeIndex:f}}}),X=["onClick"];function Z(e,t,o,p,d,f){const h=n("a-divider"),c=n("a-list-item"),i=n("a-list"),m=n("a-layout-sider"),b=n("JCodeEditor"),v=n("a-layout-content"),a=n("a-layout"),C=n("a-spin"),_=n("a-button"),s=n("BasicModal");return H(),N(s,{onRegister:e.registerModal,title:"JS增强历史记录",width:1200,maskClosable:!1,confirmLoading:e.confirmLoading,defaultFullscreen:"",onCancel:e.onCancel},{footer:r(()=>[l(_,{onClick:e.onCancel},{default:r(()=>[S("关闭")]),_:1},8,["onClick"])]),default:r(()=>[l(C,{spinning:e.confirmLoading},{default:r(()=>[l(a,null,{default:r(()=>[l(m,{theme:"light"},{default:r(()=>[l(i,{bordered:"",dataSource:e.dataList,class:x("enhance-list")},{header:r(()=>[J("div",null,[l(h,{style:{margin:"0"}},{default:r(()=>[S("保存时间")]),_:1})])]),renderItem:r(({item:u})=>[l(c,{class:x(e.activeIndex===u.index?"bg-blue":"")},{default:r(()=>[J("a",{onClick:g=>e.fullCode(u)},V(e.getFormatDate(u.date)),9,X)]),_:2},1032,["class"])]),_:1},8,["dataSource"])]),_:1}),l(a,null,{default:r(()=>[l(v,{style:{margin:"8px 8px",padding:"8px",background:"#fff",minHeight:"280px"}},{default:r(()=>[l(b,{ref:"codeEditorRef",language:"javascript",fullScreen:!0,lineNumbers:!1,"language-change":!1},null,512)]),_:1})]),_:1})]),_:1})]),_:1},8,["spinning"])]),_:1},8,["onRegister","confirmLoading","onCancel"])}const q=D(W,[["render",Z],["__scopeId","data-v-a2408ade"]]),Xe=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));export{q as E,Xe as a,K as u};
