import{a_ as L,Z as w,c9 as D,a8 as I,V as P}from"./index-B_2CoVdl.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-D2AmS0aU.js";import"./index-ARbUvvsq.js";import $ from"./JCodeEditor-esTLnfS3.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./useForm-CcjrODHR.js";import"./componentMap-CzCGDP7x.js";import"./useFormItem-CWa0w7fA.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./JAreaLinkage-CSgDAlrn.js";import"./EasyCronInput-DclSHT47.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.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"]]),We=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"}));export{q as E,We as a,K as u};
