@steedos-widgets/amis-lib 6.10.1-beta.40 → 6.10.1-beta.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1603,7 +1603,7 @@ tpl.addable=field.permission==="editable";tpl.editable=tpl.addable;tpl.removable
1603
1603
  * @param {*} label
1604
1604
  * @returns
1605
1605
  */var getTdInputTpl=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(field,label){var _field$config,_field$config$amis;var edit;return _regeneratorRuntime().wrap(function _callee41$(_context41){while(1){switch(_context41.prev=_context41.next){case 0:if((_field$config=field.config)!==null&&_field$config!==void 0&&(_field$config$amis=_field$config.amis)!==null&&_field$config$amis!==void 0&&_field$config$amis.name){delete field.config.amis.name;}edit=field.permission==="editable";if(!edit){_context41.next=8;break;}_context41.next=5;return getFieldEditTpl(field,label);case 5:return _context41.abrupt("return",_context41.sent);case 8:_context41.next=10;return getFieldReadonlyTpl(field,label);case 10:return _context41.abrupt("return",_context41.sent);case 11:case"end":return _context41.stop();}}},_callee41);}));return function getTdInputTpl(_x275,_x276){return _ref43.apply(this,arguments);};}();var getTdField=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(field,fieldsCount){return _regeneratorRuntime().wrap(function _callee42$(_context42){while(1){switch(_context42.prev=_context42.next){case 0:_context42.t0=field.permission!=="editable"?"#FFFFFF":"rgba(255,255,0,.1)";_context42.t1=field.type==="table"?4:3-(fieldsCount-1)*2;_context42.next=4;return getTdInputTpl(field);case 4:_context42.t2=_context42.sent;_context42.t3=[_context42.t2];_context42.t4={marginTop:"0",paddingTop:"0",paddingRight:"0",paddingBottom:"0",paddingLeft:"0",marginRight:"0",marginBottom:"0",marginLeft:"0",borderLeftColor:"#000000",borderTopColor:"#000000",borderRightColor:"#000000",borderBottomColor:"#000000"};return _context42.abrupt("return",{background:_context42.t0,colspan:_context42.t1,align:"left",className:"td-field",width:"32%",body:_context42.t3,style:_context42.t4});case 8:case"end":return _context42.stop();}}},_callee42);}));return function getTdField(_x277,_x278){return _ref44.apply(this,arguments);};}();var getTdTitle=function getTdTitle(field){return{className:"td-title td-title-".concat(field.type),align:field.type!="section"?"center":"left",width:field.type!="section"?"16%":"",colspan:field.type=="section"?4:"",background:field.type=="section"?"#f1f1f1":"#FFFFFF",body:[{type:"tpl",tpl:"<div class='".concat(field.type=="section"?"font-bold":"","'>").concat(field.name||field.code," ").concat(field.is_required?'<span class="antd-Form-star">*</span>':'',"</div>")}],// "id": "u:9b001b7ff92d",
1606
- style:{borderLeftColor:"#000000",borderTopColor:"#000000",borderRightColor:"#000000",borderBottomColor:"#000000"}};};var getTds=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(tdFields){var tds,_iterator4,_step4,field;return _regeneratorRuntime().wrap(function _callee43$(_context43){while(1){switch(_context43.prev=_context43.next){case 0:tds=[];_iterator4=_createForOfIteratorHelper(tdFields);_context43.prev=2;_iterator4.s();case 4:if((_step4=_iterator4.n()).done){_context43.next=15;break;}field=_step4.value;if(field.type!="table"){tds.push(getTdTitle(field));}if(!(field.type!="section")){_context43.next=13;break;}_context43.t0=tds;_context43.next=11;return getTdField(field,tdFields.length);case 11:_context43.t1=_context43.sent;_context43.t0.push.call(_context43.t0,_context43.t1);case 13:_context43.next=4;break;case 15:_context43.next=20;break;case 17:_context43.prev=17;_context43.t2=_context43["catch"](2);_iterator4.e(_context43.t2);case 20:_context43.prev=20;_iterator4.f();return _context43.finish(20);case 23:return _context43.abrupt("return",tds);case 24:case"end":return _context43.stop();}}},_callee43,null,[[2,17,20,23]]);}));return function getTds(_x279){return _ref45.apply(this,arguments);};}();var getFormTrs=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(instance){var trsSchema,trs,tdFields,fields,_i,_trs,_tdFields;return _regeneratorRuntime().wrap(function _callee44$(_context44){while(1){switch(_context44.prev=_context44.next){case 0:trsSchema=[];trs=[];tdFields=[];fields=[];_$1.each(instance.fields,function(field){fields.push(field);if(field.type==="section"&&field.fields){fields=fields.concat(field.fields);}});_$1.each(fields,function(field,index){if(field.is_wide){if(tdFields.length!=0){trs.push(tdFields);}if(field.type=="table"){trs.push([Object.assign({},field,{type:"section"})]);}tdFields=[];tdFields.push(field);trs.push(tdFields);tdFields=[];}else{tdFields.push(field);if(tdFields.length==2||index===fields.length-1){trs.push(tdFields);tdFields=[];}}});_i=0,_trs=trs;case 7:if(!(_i<_trs.length)){_context44.next=18;break;}_tdFields=_trs[_i];_context44.t0=trsSchema;_context44.next=12;return getTds(_tdFields);case 12:_context44.t1=_context44.sent;_context44.t2={background:"#F7F7F7",tds:_context44.t1};_context44.t0.push.call(_context44.t0,_context44.t2);case 15:_i++;_context44.next=7;break;case 18:return _context44.abrupt("return",trsSchema);case 19:case"end":return _context44.stop();}}},_callee44);}));return function getFormTrs(_x280){return _ref46.apply(this,arguments);};}();var getFormTableView=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(instance){var formSchema;return _regeneratorRuntime().wrap(function _callee45$(_context45){while(1){switch(_context45.prev=_context45.next){case 0:_context45.next=2;return getFormTrs(instance);case 2:_context45.t0=_context45.sent;formSchema={type:"table-view",className:"instance-form-view",trs:_context45.t0,id:"u:047f3669468b"};return _context45.abrupt("return",formSchema);case 5:case"end":return _context45.stop();}}},_callee45);}));return function getFormTableView(_x281){return _ref47.apply(this,arguments);};}();var getApplicantTableView=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(instance){var applicantInput;return _regeneratorRuntime().wrap(function _callee46$(_context46){while(1){switch(_context46.prev=_context46.next){case 0:applicantInput=null;if(!(instance.state==='draft')){_context46.next=10;break;}_context46.t0=Object;_context46.t1={name:"applicant",value:amisLib.getSteedosAuth().userId,disabled:instance.box!=='draft'};_context46.next=6;return amisLib.lookupToAmis({name:"applicant",label:false,reference_to:"space_users",reference_to_field:'user',multiple:false},false,{});case 6:_context46.t2=_context46.sent;applicantInput=_context46.t0.assign.call(_context46.t0,_context46.t1,_context46.t2);_context46.next=11;break;case 10:applicantInput={label:false,mode:"horizontal",className:"m-none p-none",disabled:true,type:"tpl",tpl:'<div>${applicant_name}</div>',id:"u:2016b04355f4"};case 11:if(applicantInput){if(applicantInput.className){applicantInput.className="".concat(applicantInput.className," inline-left");}else{applicantInput.className="inline-left";}}return _context46.abrupt("return",{type:"table-view",className:"instance-applicant-view",trs:[{background:"#FFFFFF",tds:[{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>提交人:</div>",id:"u:ee62634201bf"},applicantInput],id:"u:6c24c1bb99c9",style:{padding:"none"}},{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>提交日期:</div>",id:"u:6d0a7763d527"},{label:false,mode:"horizontal",className:"m-none p-none inline-left",disabled:true,type:"tpl",inputFormat:"YYYY-MM-DD",valueFormat:"YYYY-MM-DDT00:00:00.000[Z]",tpl:'<div>${submit_date}</div>',id:"u:2016b04355f4"}],id:"u:c8b8214ac931",style:{padding:"none"}}]}],id:"u:047f3669468b",style:{borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none"}});case 13:case"end":return _context46.stop();}}},_callee46);}));return function getApplicantTableView(_x282){return _ref48.apply(this,arguments);};}();var getApproveButton=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(instance){return _regeneratorRuntime().wrap(function _callee47$(_context47){while(1){switch(_context47.prev=_context47.next){case 0:if(!(!instance.approve||instance.box!='inbox'&&instance.box!='draft')){_context47.next=2;break;}return _context47.abrupt("return",null);case 2:_context47.t0={};_context47.next=5;return getApprovalDrawerSchema(instance);case 5:_context47.t1=_context47.sent;_context47.t2={componentId:"",args:_context47.t0,actionType:"drawer",drawer:_context47.t1};_context47.t3=[_context47.t2];_context47.t4={actions:_context47.t3};_context47.t5={click:_context47.t4};return _context47.abrupt("return",{type:"button",label:"签批",onEvent:_context47.t5,id:"steedos-approve-button",level:"primary",className:"approve-button w-14 h-14 rounded-full fixed bottom-4 right-4 shadow-lg text-white text-base text-center font-semibold bg-blue-500 p-0"});case 11:case"end":return _context47.stop();}}},_callee47);}));return function getApproveButton(_x283){return _ref49.apply(this,arguments);};}();var getFlowFormSchema=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(instance,box){return _regeneratorRuntime().wrap(function _callee48$(_context48){while(1){switch(_context48.prev=_context48.next){case 0:_context48.t0={"type":"steedos-record-detail-header","label":"标题面板","objectApiName":"instances","recordId":instance._id,"id":"u:e6b2adbe0e21","showRecordTitle":false,"className":"p-0 m-0 p0 m0 bg-gray-50"};_context48.t1={".steedos-amis-instance-view-body":{"height":"calc(100% - 65px)"},".instance-approve-history .antd-Table-table thead":{"display":"none"},".instance-approve-history .antd-Table-heading":{"font-size":"14px","font-weight":"500","padding-left":"0px"},".antd-List-heading":{"font-size":"14px","font-weight":"500"},".steedos-object-record-detail-header .antd-Grid-col--mdAuto":{"padding":"0px !important"},".steedos-amis-instance-view .antd-Page-body":{"width":"1024px"},".antd-List-placeholder":{"display":"none"},".steedos-amis-instance-view .antd-Table-fixedTop":{"top":"-13px"},".steedos-amis-instance-view .antd-Table-fixedTop:after":{"box-shadow":"none"},".antd-List-items":{"border":'0px'},".antd-ListItem":{"border-top":"0px !important","background":"transparent !important"}};_context48.next=4;return getAttachments(instance);case 4:_context48.t2=_context48.sent;_context48.next=7;return getRelatedInstances();case 7:_context48.t3=_context48.sent;_context48.next=10;return getRelatedRecords(instance);case 10:_context48.t4=_context48.sent;_context48.t5={type:"tpl",id:"u:f5bb0ad602a6",tpl:"<div class=\"instance-name\">".concat(instance.title,"</div>"),inline:true,wrapperComponent:"",style:{fontFamily:"",fontSize:12,textAlign:"center"}};_context48.next=14;return getFormTableView(instance);case 14:_context48.t6=_context48.sent;_context48.next=17;return getApplicantTableView(instance);case 17:_context48.t7=_context48.sent;_context48.t8=[_context48.t5,_context48.t6,_context48.t7];_context48.t9={validateError:{weight:0,actions:[{"componentId":"","args":{"msgType":"info","position":"top-right","closeButton":true,"showIcon":true,"title":"提交失败","msg":"请填写必填字段"},"actionType":"toast"}]}};_context48.t10={type:"form",debug:false,wrapWithPanel:false,resetAfterSubmit:true,body:_context48.t8,id:"instance_form",onEvent:_context48.t9};_context48.next=23;return getInstanceApprovalHistory();case 23:_context48.t11=_context48.sent;_context48.next=26;return getApproveButton(instance);case 26:_context48.t12=_context48.sent;_context48.t13=[_context48.t2,_context48.t3,_context48.t4,_context48.t10,_context48.t11,_context48.t12];_context48.t14={};_context48.t15={};_context48.t16=["body","header"];_context48.t17={"@data.@instanceDetail.changed":{actions:[{actionType:"reload"}]}// inited: {
1606
+ style:{borderLeftColor:"#000000",borderTopColor:"#000000",borderRightColor:"#000000",borderBottomColor:"#000000"}};};var getTds=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(tdFields){var tds,_iterator4,_step4,field;return _regeneratorRuntime().wrap(function _callee43$(_context43){while(1){switch(_context43.prev=_context43.next){case 0:tds=[];_iterator4=_createForOfIteratorHelper(tdFields);_context43.prev=2;_iterator4.s();case 4:if((_step4=_iterator4.n()).done){_context43.next=15;break;}field=_step4.value;if(field.type!="table"){tds.push(getTdTitle(field));}if(!(field.type!="section")){_context43.next=13;break;}_context43.t0=tds;_context43.next=11;return getTdField(field,tdFields.length);case 11:_context43.t1=_context43.sent;_context43.t0.push.call(_context43.t0,_context43.t1);case 13:_context43.next=4;break;case 15:_context43.next=20;break;case 17:_context43.prev=17;_context43.t2=_context43["catch"](2);_iterator4.e(_context43.t2);case 20:_context43.prev=20;_iterator4.f();return _context43.finish(20);case 23:return _context43.abrupt("return",tds);case 24:case"end":return _context43.stop();}}},_callee43,null,[[2,17,20,23]]);}));return function getTds(_x279){return _ref45.apply(this,arguments);};}();var getFormTrs=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(instance){var trsSchema,trs,tdFields,fields,_i,_trs,_tdFields;return _regeneratorRuntime().wrap(function _callee44$(_context44){while(1){switch(_context44.prev=_context44.next){case 0:trsSchema=[];trs=[];tdFields=[];fields=[];_$1.each(instance.fields,function(field){fields.push(field);if(field.type==="section"&&field.fields){fields=fields.concat(field.fields);}});_$1.each(fields,function(field,index){if(field.is_wide){if(tdFields.length!=0){trs.push(tdFields);}if(field.type=="table"){trs.push([Object.assign({},field,{type:"section"})]);}tdFields=[];tdFields.push(field);trs.push(tdFields);tdFields=[];}else{tdFields.push(field);if(tdFields.length==2||index===fields.length-1){trs.push(tdFields);tdFields=[];}}});_i=0,_trs=trs;case 7:if(!(_i<_trs.length)){_context44.next=18;break;}_tdFields=_trs[_i];_context44.t0=trsSchema;_context44.next=12;return getTds(_tdFields);case 12:_context44.t1=_context44.sent;_context44.t2={background:"#F7F7F7",tds:_context44.t1};_context44.t0.push.call(_context44.t0,_context44.t2);case 15:_i++;_context44.next=7;break;case 18:return _context44.abrupt("return",trsSchema);case 19:case"end":return _context44.stop();}}},_callee44);}));return function getFormTrs(_x280){return _ref46.apply(this,arguments);};}();var getFormTableView=/*#__PURE__*/function(){var _ref47=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(instance){var formSchema;return _regeneratorRuntime().wrap(function _callee45$(_context45){while(1){switch(_context45.prev=_context45.next){case 0:_context45.next=2;return getFormTrs(instance);case 2:_context45.t0=_context45.sent;formSchema={type:"table-view",className:"instance-form-view",trs:_context45.t0,id:"u:047f3669468b"};return _context45.abrupt("return",formSchema);case 5:case"end":return _context45.stop();}}},_callee45);}));return function getFormTableView(_x281){return _ref47.apply(this,arguments);};}();var getApplicantTableView=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(instance){var applicantInput;return _regeneratorRuntime().wrap(function _callee46$(_context46){while(1){switch(_context46.prev=_context46.next){case 0:applicantInput=null;if(!(instance.state==='draft')){_context46.next=10;break;}_context46.t0=Object;_context46.t1={name:"applicant",value:amisLib.getSteedosAuth().userId,disabled:instance.box!=='draft'};_context46.next=6;return amisLib.lookupToAmis({name:"applicant",label:false,reference_to:"space_users",reference_to_field:'user',multiple:false},false,{});case 6:_context46.t2=_context46.sent;applicantInput=_context46.t0.assign.call(_context46.t0,_context46.t1,_context46.t2);_context46.next=11;break;case 10:applicantInput={label:false,mode:"horizontal",className:"m-none p-none",disabled:true,type:"tpl",tpl:'<div>${applicant_name}</div>',id:"u:2016b04355f4"};case 11:if(applicantInput){if(applicantInput.className){applicantInput.className="".concat(applicantInput.className," inline-left");}else{applicantInput.className="inline-left";}}return _context46.abrupt("return",{type:"table-view",className:"instance-applicant-view",trs:[{background:"#FFFFFF",tds:[{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>提交人:</div>",id:"u:ee62634201bf"},applicantInput],id:"u:6c24c1bb99c9",style:{padding:"none"}},{className:"td-title",background:"#FFFFFF",align:"left",width:"50%",colspan:"",body:[{type:"tpl",tpl:"<div class='inline-left'>提交日期:</div>",id:"u:6d0a7763d527"},{label:false,mode:"horizontal",className:"m-none p-none inline-left",disabled:true,type:"tpl",inputFormat:"YYYY-MM-DD",valueFormat:"YYYY-MM-DDT00:00:00.000[Z]",tpl:'<div>${submit_date}</div>',id:"u:2016b04355f4"}],id:"u:c8b8214ac931",style:{padding:"none"}}]}],id:"u:047f3669468b",style:{borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none"}});case 13:case"end":return _context46.stop();}}},_callee46);}));return function getApplicantTableView(_x282){return _ref48.apply(this,arguments);};}();var getApproveButton=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(instance){return _regeneratorRuntime().wrap(function _callee47$(_context47){while(1){switch(_context47.prev=_context47.next){case 0:if(!(!instance.approve||instance.box!='inbox'&&instance.box!='draft')){_context47.next=2;break;}return _context47.abrupt("return",null);case 2:_context47.t0={};_context47.next=5;return getApprovalDrawerSchema(instance);case 5:_context47.t1=_context47.sent;_context47.t2={componentId:"",args:_context47.t0,actionType:"drawer",drawer:_context47.t1};_context47.t3=[_context47.t2];_context47.t4={actions:_context47.t3};_context47.t5={click:_context47.t4};return _context47.abrupt("return",{type:"button",label:"签批",onEvent:_context47.t5,id:"steedos-approve-button",level:"primary",className:"approve-button w-14 h-14 rounded-full fixed bottom-4 right-4 shadow-lg text-white text-base text-center font-semibold bg-blue-500 p-0"});case 11:case"end":return _context47.stop();}}},_callee47);}));return function getApproveButton(_x283){return _ref49.apply(this,arguments);};}();var getFlowFormSchema=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(instance,box){return _regeneratorRuntime().wrap(function _callee48$(_context48){while(1){switch(_context48.prev=_context48.next){case 0:_context48.t0={"type":"steedos-record-detail-header","label":"标题面板","objectApiName":"instances","recordId":instance._id,"id":"u:e6b2adbe0e21","showRecordTitle":false,"className":"p-0 m-0 p0 m0 bg-gray-50"};_context48.t1={".steedos-amis-instance-view-body":{"height":"calc(100% - 65px)"},".instance-approve-history .antd-Table-table thead":{"display":"none"},".instance-approve-history .antd-Table-heading":{"font-size":"14px","font-weight":"500","padding-left":"0px"},".antd-List-heading":{"font-size":"14px","font-weight":"500"},".steedos-object-record-detail-header .antd-Grid-col--mdAuto":{"padding":"0px !important"},".steedos-amis-instance-view .antd-Page-body":{"width":"1024px"},".antd-List-placeholder":{"display":"none"},".steedos-amis-instance-view .antd-Table-fixedTop":{"top":"-13px"},".steedos-amis-instance-view .antd-Table-fixedTop:after":{"box-shadow":"none"},".antd-List-items":{"border":'0px'},".antd-ListItem":{"border-top":"0px !important","background":"transparent !important"}};_context48.next=4;return getAttachments(instance);case 4:_context48.t2=_context48.sent;_context48.next=7;return getRelatedInstances();case 7:_context48.t3=_context48.sent;_context48.next=10;return getRelatedRecords(instance);case 10:_context48.t4=_context48.sent;_context48.t5={type:"tpl",id:"u:f5bb0ad602a6",tpl:"<div class=\"instance-name\">".concat(instance.title,"</div>"),inline:true,wrapperComponent:"",style:{fontFamily:"",fontSize:12,textAlign:"center"}};_context48.next=14;return getFormTableView(instance);case 14:_context48.t6=_context48.sent;_context48.next=17;return getApplicantTableView(instance);case 17:_context48.t7=_context48.sent;_context48.t8=[_context48.t5,_context48.t6,_context48.t7];_context48.t9={validateError:{weight:0,actions:[{"componentId":"","args":{"msgType":"info","position":"top-right","closeButton":true,"showIcon":true,"title":"提交失败","msg":"请填写必填字段"},"actionType":"toast"}]},change:{weight:0,actions:[{"actionType":"reload","componentId":"u:next_step","args":{}}]}};_context48.t10={type:"form",debug:false,wrapWithPanel:false,resetAfterSubmit:true,body:_context48.t8,id:"instance_form",onEvent:_context48.t9};_context48.next=23;return getInstanceApprovalHistory();case 23:_context48.t11=_context48.sent;_context48.next=26;return getApproveButton(instance);case 26:_context48.t12=_context48.sent;_context48.t13=[_context48.t2,_context48.t3,_context48.t4,_context48.t10,_context48.t11,_context48.t12];_context48.t14={};_context48.t15={};_context48.t16=["body","header"];_context48.t17={"@data.@instanceDetail.changed":{actions:[{actionType:"reload"}]}// inited: {
1607
1607
  // weight: 0,
1608
1608
  // actions: [
1609
1609
  // // {