"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[6474,689],{689:function(l,o,e){e.r(o),e.d(o,{JSCollectionActionRunJSContext:function(){return t}});var _=e(72004),s=e.n(_),r=e(12444),a=e.n(r),c=e(31996),u=e.n(c),i=e(26037),d=e.n(i),m=e(67946),t=function(b){u()(n,b);var C=d()(n);function n(){return a()(this,n),C.apply(this,arguments)}return s()(n)}(m.Uo);t.define({label:"JSCollectionAction RunJS context",properties:{resource:`Collection resource instance providing access to selected rows, pagination, and data operations.
      Use ctx.resource.selectedRows to get selected records.
      Use ctx.resource.pagination for page info.`}}),t.define({label:"JS \u96C6\u5408\u52A8\u4F5C RunJS \u4E0A\u4E0B\u6587",properties:{resource:"\u5217\u8868\u8D44\u6E90\uFF08\u5305\u542B\u9009\u4E2D\u884C/\u5206\u9875\u4FE1\u606F\u7B49\uFF09"}},{locale:"zh-CN"})},36474:function(l,o,e){e.r(o);var _=e(689),s={contexts:[_.JSCollectionActionRunJSContext],prefix:"sn-act-export",label:"Export selected rows as JSON",description:"Download selected rows as a JSON file",locales:{"zh-CN":{label:"\u5BFC\u51FA\u9009\u4E2D\u884C\u4E3A JSON",description:"\u5C06\u9009\u4E2D\u7684\u884C\u5BFC\u51FA\u4E3A JSON \u6587\u4EF6\u4E0B\u8F7D"}},content:`
const rows = ctx.resource?.getSelectedRows?.() || [];
if (!rows.length) {
  ctx.message.warning(ctx.t('Please select at least one row'));
  return;
}

// Create JSON file and download
const jsonStr = JSON.stringify(rows, null, 2);
const blob = new Blob([jsonStr], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = \`export-\${new Date().toISOString().split('T')[0]}.json\`;
link.click();
URL.revokeObjectURL(url);

ctx.message.success(ctx.t('Exported {{count}} records', { count: rows.length }));
`};o.default=s}}]);
