UNPKG

@nocobase/plugin-action-bulk-edit

Version:

Batch edit all records or selected records.

10 lines (9 loc) 4.03 kB
/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ "use strict";(self.webpackChunk_nocobase_plugin_action_bulk_edit_client_v2=self.webpackChunk_nocobase_plugin_action_bulk_edit_client_v2||[]).push([["398"],{861:function(e,t,r){r.r(t),r.d(t,{BulkEditFormModel:function(){return f}});var n=r(485),o=r(694);function u(e,t,r,n,o,u,i){try{var c=e[u](i),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(n,o)}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var f=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=c(t),i(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(t,n||[],c(this).constructor):t.apply(this,n)),"customModelClasses",{FormActionGroupModel:"BulkEditFormActionGroupModel",FormItemModel:"BulkEditFormItemModel"}),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&l(r,e),t=[{key:"getAclActionName",value:function(){return"update"}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(n.CreateFormModel);i(f,"scene",n.BlockSceneEnum.bulkEditForm),f.define({label:(0,o.tExpr)("Form"),children:!1,createModelOptions:function(e,t){var r;return(r=function(){var t,r,n;return function(e,t){var r,n,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:l(0)}),c(i,"throw",{value:l(1)}),c(i,"return",{value:l(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function l(c){return function(l){var a=[c,l];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,n=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(o){return n=(r=(null==(t=e.view)?void 0:t.inputArgs)||{}).collectionName,[2,{use:"BulkEditFormModel",subModels:{grid:{use:"BulkEditFormGridModel"}},stepParams:{resourceSettings:{init:{dataSourceKey:r.dataSourceKey,collectionName:n}}}}]})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function c(e){u(i,n,o,c,l,"next",e)}function l(e){u(i,n,o,c,l,"throw",e)}c(void 0)})})()}})}}]);