@tachybase/plugin-workflow-approval 1.0.6 → 1.0.18

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.
@@ -213,7 +213,7 @@ Error generating stack: `+s.message+`
213
213
  .ant-drawer-body {
214
214
  background: var(--tb-box-bg);
215
215
  }
216
- `},properties:{[w]:{type:"void","x-decorator":"CollectionProvider_deprecated","x-decorator-props":{name:g,dataSource:k},"x-component":"RemoteSchemaComponent","x-component-props":{uid:w,noForm:!0}}}}}}),s(!0)},[n]);return d.jsxs(p.ActionContextProvider,{value:{visible:r,setVisible:s},children:[n==null?void 0:n.map((y,w)=>d.jsx(H.Row,{children:y==null?void 0:y.map((k,g)=>d.jsx(H.Col,{span:6,children:d.jsx(H.Button,{style:{width:"100%",height:"100%",border:"1px solid #f3f3f3",textAlign:"center",padding:"20px 10px"},onClick:()=>{u(k)},children:k.title})},g))},w)),d.jsx(p.SchemaComponentContext.Provider,{value:U(A({},l),{designable:!1}),children:d.jsx(p.SchemaComponent,{schema:i,components:{RemoteSchemaComponent:p.RemoteSchemaComponent,CollectionProvider_deprecated:p.CollectionProvider_deprecated,FlowContextProvider:ol,ApplyActionStatusProvider:Id,ActionBarProvider:Fd,ProviderActionResubmit:()=>null,WithdrawActionProvider:r0,ProviderActionReminder:Dd},scope:{useSubmit:il,useWithdrawAction:Td,useActionResubmit:rl,useActionReminder:Pd}})})]})},yA={title:K("ApprovalCarbonCopy"),name:br,fields:[{type:"bigInt",name:"approvalId",interface:"number",uiSchema:{type:"number",title:"ID","x-component":"InputNumber"}},{type:"belongsTo",name:"createdBy",target:"users",foreignKey:"createdById",interface:"m2o",uiSchema:{type:"number",title:`{{t("Initiator", { ns: "${V}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"bigInt",name:"id",interface:"number",uiSchema:{type:"number",title:"ID","x-component":"InputNumber"}},{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",interface:"m2o",uiSchema:{type:"number",title:K("The Notified Person"),"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"belongsTo",name:"node",target:"flow_nodes",foreignKey:"nodeId",interface:"m2o",isAssociation:!0,uiSchema:{type:"number",title:`{{t("Task node", { ns: "${V}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes"}}}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"number",title:'{{t("Workflow", { ns: "workflow" })}}',"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"workflows"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "workflow" })}}',"x-component":"Select",enum:ul}},{type:"text",name:"comment",interface:"markdown",uiSchema:{type:"string","x-component":"Markdown",title:`{{t("Comment", { ns: "${V}" })}}`}},{name:"createdAt",type:"date",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}},{name:"updatedAt",type:"date",interface:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Updated at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"string",name:"summary",interface:"input",uiSchema:{type:"string",title:K("Summary"),"x-component":"ApprovalsSummary","x-component-props":{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "workflow" })}}',"x-component":"Select",enum:dl}}]},Od={title:K("Node"),name:"flow_nodes",fields:[{type:"bigInt",name:"id",interface:"m2o",uiSchema:{type:"number",title:"ID","x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes",params:{filter:{type:"manual"}}}}}},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}}]},$d={title:`{{t("Approval Launch", { ns: "${V}" })}}`,name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"description",interface:"input",uiSchema:{title:'{{t("Description")}}',type:"string","x-component":"Input.TextArea"}},{type:"boolean",name:"enabled",interface:"select",uiSchema:{type:"boolean",title:'{{t("Status", { ns: "workflow" })}}',"x-component":"Select",enum:[{label:'{{t("On", { ns: "workflow" })}}',value:!0},{label:'{{t("Off", { ns: "workflow" })}}',value:!1}]}}]},gA=n=>{var o=n,{children:e}=o,t=Fe(o,["children"]);const{collection:r,params:s={filter:{}},action:i="list"}=t,a=p.useRecord(),l={collection:r,resource:r,action:i,params:U(A({pageSize:20,sort:["-createdAt"]},s),{filter:a!=null&&a.id?A({dataKey:`${a.id}`},s.filter):A({},s.filter)}),rowKey:"id",showIndex:!0,dragSort:!1};return d.jsx(p.ExtendCollectionsProvider,{collections:[$d,Od,yA],children:d.jsx(p.TableBlockProvider,U(A({name:r},l),{children:e}))})},xA=N.observer(()=>{const e=p.useCollectionRecordData(),{approval:t}=e;return d.jsx(CA,{value:t==null?void 0:t.status,record:e})},{displayName:"ColumnApprovalStatus"}),CA=e=>{const t=p.useCompile(),{value:n}=e,o=qs[n];return d.jsx(H.Tag,{color:o.color,children:t(o.label)})},m0=f.createContext({}),wA=m0.Provider;function SA(){return f.useContext(m0)}const h0=f.createContext({}),kA=h0.Provider;function bA(){return f.useContext(h0)}function AA(){const{snapshot:e}=bA(),{form:t}=p.useFormBlockContext();return f.useEffect(()=>{t.setValues(e)},[t,e]),{form:t}}const v0=n=>{var o=n,{children:e}=o,t=Fe(o,["children"]);const r=p.useSchemaComponentContext(),{t:s}=be(),{id:i}=p.useCollectionRecordData(),{loading:a,data:l}=EA(i);if(a)return d.jsx(H.Spin,{});if(!(l!=null&&l.data))return d.jsx(H.Result,{status:"error",title:s("Submission may be withdrawn, please try refresh the list.")});const c=l.data,{node:u,workflow:h,execution:m}=c,v=u==null?void 0:u.config.showCarbonCopyDetail,{designable:y}=t;return d.jsx(_.ExecutionContextProvider,{workflow:h,nodes:h.nodes,execution:m,children:d.jsx(kA,{value:c,children:d.jsx(wA,{value:{id:i,schemaId:v},children:d.jsx(p.SchemaComponentContext.Provider,{value:U(A({},r),{designable:y}),children:e})})})})};function EA(e){const{loading:t,data:n}=p.useRequest({resource:br,action:"get",params:{filterByTk:e,appends:["node","job","workflow","workflow.nodes","execution","execution.jobs","user"],except:["workflow.config","workflow.options","nodes.config"],sort:["-createdAt"]}},{refreshDeps:[e]});return{loading:t,data:n}}const PA=()=>d.jsx(v0,{children:d.jsx(IA,{})}),IA=e=>{const{id:t,schemaId:n}=SA();return d.jsx(p.SchemaComponent,{components:{NoticeDetailProvider:v0,RemoteSchemaComponent:p.RemoteSchemaComponent,SchemaComponentProvider:p.SchemaComponentProvider,DetailsBlockProvider:_.DetailsBlockProvider},scope:{usePropsNoticeDetail:AA,useDetailsBlockProps:p.useFormBlockContext},schema:{name:`content-${t}`,type:"void","x-component":"Tabs",properties:{detail:{type:"void",title:K("Content Detail"),"x-component":"Tabs.TabPane",properties:{detail:{type:"void","x-decorator":"NoticeDetailProvider","x-decorator-props":{designable:!1},"x-component":"RemoteSchemaComponent","x-component-props":{uid:n,noForm:!0}}}}}}})},TA=({record:e})=>{const{id:t}=e;return{name:`notice-view-${t}`,type:"void","x-component":"Action.Link",title:'{{t("View")}}',properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"tb-action-popup"},properties:{content:{type:"void","x-component":"NoticeDetailContent"}}}}}},DA=()=>{const e=p.useCollectionRecordData(),t=TA({record:e});return d.jsx(p.SchemaComponent,{schema:t,components:{NoticeDetailContent:PA}})},_A=N.observer(()=>{const e=N.useField(),t=e==null?void 0:e.value;return t!=null&&t.title?t.title:t!=null&&t.id?`#${t.id}`:""},{displayName:"ColumnNode"}),NA=N.observer(()=>{const{value:e}=N.useField(),t=p.useRecord();return d.jsx(FA,{value:e,record:t})},{displayName:"ColumnStatus"}),FA=e=>{const{value:t,record:n}=e,o=ge.omit(e,["value","record"]),r=p.useCompile(),{t:s}=be(),{option:i=OA[t]}=o,{workflow:a,execution:l,job:c}=n!=null?n:{};return(!(a!=null&&a.enabled)||l!=null&&l.stauts||c!=null&&c.status)&&[].includes(t)?d.jsx(H.Tag,{children:s("Unprocessed")}):d.jsx(H.Tag,{color:i==null?void 0:i.color,children:r(i==null?void 0:i.label)})},OA=[{value:_.EXECUTION_STATUS.QUEUEING,label:`{{t("Assigned", { ns: "${V}" })}}`,color:"blue"},{value:_.EXECUTION_STATUS.STARTED,label:`{{t("Pending", { ns: "${V}" })}}`,color:"gold"},{value:2,label:`{{t("Approved", { ns: "${V}" })}}`,color:"green"},{value:_.EXECUTION_STATUS.REJECTED,label:`{{t("Rejected", { ns: "${V}" })}}`,color:"red"}].reduce((e,t)=>Object.assign(e,{[t.value]:t}),{}),$A=N.observer(()=>{const e=N.useField(),t=e==null?void 0:e.value;return t!=null&&t.nickname?t.nickname:(t==null?void 0:t.id)!==void 0?t.id:""},{displayName:"ColumnUser"}),BA=N.observer(()=>{const{t:e}=be(),{value:t}=N.useField(),n=(t==null?void 0:t.title)||`#${t==null?void 0:t.id}`;return t!=null&&t.enabled?n:d.jsx("span",{title:e("Disabled"),children:`${n}*`})},{displayName:"ColumnWorkflow"}),Bd=e=>{const{handleSearch:t,handleValueChange:n}=MA(e),{t:o}=be();return d.jsx(H.Space.Compact,{style:{width:300},children:d.jsx(H.Input.Search,{placeholder:o("Search Summary"),allowClear:!0,onSearch:t,onChange:n})})};function MA(e){const{isInitiationTable:t}=e,n=p.useDataBlockRequest(),o=p.useDataBlockProps(),r=i=>{var a;y0({isInitiationTable:t,queryValue:i.trim(),defaultFilter:(a=o==null?void 0:o.params)==null?void 0:a.filter,service:n})},s=ge.debounce(i=>{var l,c;((l=i.target)==null?void 0:l.value)||y0({isInitiationTable:t,queryValue:"",defaultFilter:(c=o==null?void 0:o.params)==null?void 0:c.filter,service:n})});return{handleSearch:r,handleValueChange:s}}function y0({isInitiationTable:e,queryValue:t,defaultFilter:n,service:o}){var l,c,u;const r=((c=(l=o.params)==null?void 0:l[1])==null?void 0:c.filters)||{},s=LA(t,e),i=p.mergeFilter([...Object.values(r),n,s]),a=U(A({},(u=o.params)==null?void 0:u[0]),{page:1,filter:i});o.run(a,{filters:r})}function LA(e,t){if(!e)return{};const n=[];return/^\d{4}-\d{2}-\d{2}/.test(e)&&(e=new Date(e).toISOString().substring(0,10),n.push({createdAt:{$dateOn:e}})),n.push({summary:{$containsJsonbValue:e}},{createdBy:{nickname:{$includes:e}}},void 0),t||n.push({user:{nickname:{$includes:e}}}),e&&Number.isFinite(Number(e))&&n.push({[t?"id":"approvalId"]:{$eq:e}}),{$or:n}}const zA={ActionbarStyle:p.css`
216
+ `},properties:{[w]:{type:"void","x-decorator":"CollectionProvider_deprecated","x-decorator-props":{name:g,dataSource:k},"x-component":"RemoteSchemaComponent","x-component-props":{uid:w,noForm:!0}}}}}}),s(!0)},[n]);return d.jsxs(p.ActionContextProvider,{value:{visible:r,setVisible:s},children:[n==null?void 0:n.map((y,w)=>d.jsx(H.Row,{children:y==null?void 0:y.map((k,g)=>d.jsx(H.Col,{span:6,children:d.jsx(H.Button,{style:{width:"100%",height:"100%",border:"1px solid #f3f3f3",textAlign:"center",padding:"20px 10px"},onClick:()=>{u(k)},children:k.title})},g))},w)),d.jsx(p.SchemaComponentContext.Provider,{value:U(A({},l),{designable:!1}),children:d.jsx(p.SchemaComponent,{schema:i,components:{RemoteSchemaComponent:p.RemoteSchemaComponent,CollectionProvider_deprecated:p.CollectionProvider_deprecated,FlowContextProvider:ol,ApplyActionStatusProvider:Id,ActionBarProvider:Fd,ProviderActionResubmit:()=>null,WithdrawActionProvider:r0,ProviderActionReminder:Dd},scope:{useSubmit:il,useWithdrawAction:Td,useActionResubmit:rl,useActionReminder:Pd}})})]})},yA={title:K("ApprovalCarbonCopy"),name:br,fields:[{type:"bigInt",name:"approvalId",interface:"number",uiSchema:{type:"number",title:"ID","x-component":"InputNumber"}},{type:"belongsTo",name:"createdBy",target:"users",foreignKey:"createdById",interface:"m2o",uiSchema:{type:"number",title:`{{t("Initiator", { ns: "${V}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"bigInt",name:"id",interface:"number",uiSchema:{type:"number",title:"ID","x-component":"InputNumber"}},{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",interface:"m2o",uiSchema:{type:"number",title:K("The Notified Person"),"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"nickname",value:"id"},service:{resource:"users"}}}},{type:"belongsTo",name:"node",target:"flow_nodes",foreignKey:"nodeId",interface:"m2o",isAssociation:!0,uiSchema:{type:"number",title:`{{t("Task node", { ns: "${V}" })}}`,"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes"}}}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",interface:"m2o",uiSchema:{type:"number",title:'{{t("Workflow", { ns: "workflow" })}}',"x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"workflows"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "workflow" })}}',"x-component":"Select",enum:ul}},{type:"text",name:"comment",interface:"markdown",uiSchema:{type:"string","x-component":"Markdown",title:`{{t("Comment", { ns: "${V}" })}}`}},{name:"createdAt",type:"date",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}},{name:"updatedAt",type:"date",interface:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Updated at")}}',"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"string",name:"summary",interface:"input",uiSchema:{type:"string",title:K("Summary"),"x-component":"ApprovalsSummary","x-component-props":{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "workflow" })}}',"x-component":"Select",enum:dl}}]},Od={title:K("Node"),name:"flow_nodes",fields:[{type:"bigInt",name:"id",interface:"m2o",uiSchema:{type:"number",title:"ID","x-component":"RemoteSelect","x-component-props":{fieldNames:{label:"title",value:"id"},service:{resource:"flow_nodes",params:{filter:{type:"manual"}}}}}},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}}]},$d={title:`{{t("Approval Launch", { ns: "${V}" })}}`,name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"description",interface:"input",uiSchema:{title:'{{t("Description")}}',type:"string","x-component":"Input.TextArea"}},{type:"boolean",name:"enabled",interface:"select",uiSchema:{type:"boolean",title:'{{t("Status", { ns: "workflow" })}}',"x-component":"Select",enum:[{label:'{{t("On", { ns: "workflow" })}}',value:!0},{label:'{{t("Off", { ns: "workflow" })}}',value:!1}]}}]},gA=n=>{var o=n,{children:e}=o,t=Fe(o,["children"]);const{collection:r,params:s={filter:{}},action:i="list"}=t,a=p.useRecord(),l={collection:r,resource:r,action:i,params:U(A({pageSize:20,sort:["-createdAt"]},s),{filter:a!=null&&a.id?A({dataKey:`${a.id}`},s.filter):A({},s.filter)}),rowKey:"id",showIndex:!0,dragSort:!1};return d.jsx(p.ExtendCollectionsProvider,{collections:[$d,Od,yA],children:d.jsx(p.TableBlockProvider,U(A({name:r},l),{children:e}))})},xA=N.observer(()=>{const e=p.useCollectionRecordData(),{approval:t}=e;return d.jsx(CA,{value:t==null?void 0:t.status,record:e})},{displayName:"ColumnApprovalStatus"}),CA=e=>{const t=p.useCompile(),{value:n}=e,o=qs[n];return d.jsx(H.Tag,{color:o.color,children:t(o.label)})},m0=f.createContext({}),wA=m0.Provider;function SA(){return f.useContext(m0)}const h0=f.createContext({}),kA=h0.Provider;function bA(){return f.useContext(h0)}function AA(){const{snapshot:e}=bA(),{form:t}=p.useFormBlockContext();return f.useEffect(()=>{t.setValues(e)},[t,e]),{form:t}}const v0=n=>{var o=n,{children:e}=o,t=Fe(o,["children"]);const r=p.useSchemaComponentContext(),{t:s}=be(),{id:i}=p.useCollectionRecordData(),{loading:a,data:l}=EA(i);if(a)return d.jsx(H.Spin,{});if(!(l!=null&&l.data))return d.jsx(H.Result,{status:"error",title:s("Submission may be withdrawn, please try refresh the list.")});const c=l.data,{node:u,workflow:h,execution:m}=c,v=u==null?void 0:u.config.showCarbonCopyDetail,{designable:y}=t;return d.jsx(_.ExecutionContextProvider,{workflow:h,nodes:h.nodes,execution:m,children:d.jsx(kA,{value:c,children:d.jsx(wA,{value:{id:i,schemaId:v},children:d.jsx(p.SchemaComponentContext.Provider,{value:U(A({},r),{designable:y}),children:e})})})})};function EA(e){const{loading:t,data:n}=p.useRequest({resource:br,action:"get",params:{filterByTk:e,appends:["node","job","workflow","workflow.nodes","execution","execution.jobs","user"],except:["workflow.config","workflow.options","nodes.config"],sort:["-createdAt"]}},{refreshDeps:[e]});return{loading:t,data:n}}const PA=()=>d.jsx(v0,{children:d.jsx(IA,{})}),IA=e=>{const{id:t,schemaId:n}=SA();return d.jsx(p.SchemaComponent,{components:{NoticeDetailProvider:v0,RemoteSchemaComponent:p.RemoteSchemaComponent,SchemaComponentProvider:p.SchemaComponentProvider,DetailsBlockProvider:_.DetailsBlockProvider},scope:{usePropsNoticeDetail:AA,useDetailsBlockProps:p.useFormBlockContext},schema:{name:`content-${t}`,type:"void","x-component":"Tabs",properties:{detail:{type:"void",title:K("Content Detail"),"x-component":"Tabs.TabPane",properties:{detail:{type:"void","x-decorator":"NoticeDetailProvider","x-decorator-props":{designable:!1},"x-component":"RemoteSchemaComponent","x-component-props":{uid:n,noForm:!0}}}}}}})},TA=({record:e})=>{const{id:t}=e;return{name:`notice-view-${t}`,type:"void","x-component":"Action.Link",title:'{{t("View")}}',properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"tb-action-popup"},properties:{content:{type:"void","x-component":"NoticeDetailContent"}}}}}},DA=()=>{const e=p.useCollectionRecordData(),t=TA({record:e});return d.jsx(p.SchemaComponent,{schema:t,components:{NoticeDetailContent:PA}})},_A=N.observer(()=>{const e=N.useField(),t=e==null?void 0:e.value;return t!=null&&t.title?t.title:t!=null&&t.id?`#${t.id}`:""},{displayName:"ColumnNode"}),NA=N.observer(()=>{const{value:e}=N.useField(),t=p.useRecord();return d.jsx(FA,{value:e,record:t})},{displayName:"ColumnStatus"}),FA=e=>{const{value:t,record:n}=e,o=ge.omit(e,["value","record"]),r=p.useCompile(),{t:s}=be(),{option:i=OA[t]}=o,{workflow:a,execution:l,job:c}=n!=null?n:{};return(!(a!=null&&a.enabled)||l!=null&&l.stauts||c!=null&&c.status)&&[].includes(t)?d.jsx(H.Tag,{children:s("Unprocessed")}):d.jsx(H.Tag,{color:i==null?void 0:i.color,children:r(i==null?void 0:i.label)})},OA=[{value:_.EXECUTION_STATUS.QUEUEING,label:`{{t("Assigned", { ns: "${V}" })}}`,color:"blue"},{value:_.EXECUTION_STATUS.STARTED,label:`{{t("Pending", { ns: "${V}" })}}`,color:"gold"},{value:2,label:`{{t("Approved", { ns: "${V}" })}}`,color:"green"},{value:_.EXECUTION_STATUS.REJECTED,label:`{{t("Rejected", { ns: "${V}" })}}`,color:"red"}].reduce((e,t)=>Object.assign(e,{[t.value]:t}),{}),$A=N.observer(()=>{const e=N.useField(),t=e==null?void 0:e.value;return t!=null&&t.nickname?t.nickname:(t==null?void 0:t.id)!==void 0?t.id:""},{displayName:"ColumnUser"}),BA=N.observer(()=>{const{t:e}=be(),{value:t}=N.useField(),n=(t==null?void 0:t.title)||`#${t==null?void 0:t.id}`;return t!=null&&t.enabled?n:d.jsx("span",{title:e("Disabled"),children:`${n}*`})},{displayName:"ColumnWorkflow"}),Bd=e=>{const{handleSearch:t,handleValueChange:n}=MA(e),{t:o}=be();return d.jsx(H.Space.Compact,{style:{width:300},children:d.jsx(H.Input.Search,{placeholder:o("Search Summary"),allowClear:!0,onSearch:t,onChange:n})})};function MA(e){const{isInitiationTable:t}=e,n=p.useDataBlockRequest(),o=p.useDataBlockProps(),r=i=>{var a;y0({isInitiationTable:t,queryValue:i.trim(),defaultFilter:(a=o==null?void 0:o.params)==null?void 0:a.filter,service:n})},s=ge.debounce(i=>{var l,c;((l=i.target)==null?void 0:l.value)||y0({isInitiationTable:t,queryValue:"",defaultFilter:(c=o==null?void 0:o.params)==null?void 0:c.filter,service:n})});return{handleSearch:r,handleValueChange:s}}function y0({isInitiationTable:e,queryValue:t,defaultFilter:n,service:o}){var l,c,u;const r=((c=(l=o.params)==null?void 0:l[1])==null?void 0:c.filters)||{},s=LA(t,e),i=p.mergeFilter([...Object.values(r),n,s]),a=U(A({},(u=o.params)==null?void 0:u[0]),{page:1,filter:i});o.run(a,{filters:r})}function LA(e,t){if(!e)return{};const n=[];return/^\d{4}-\d{2}-\d{2}/.test(e)&&(e=new Date(e).toISOString().substring(0,10),n.push({createdAt:{$dateOn:e}})),n.push({summary:{$containsJsonbValue:e}},{createdBy:{nickname:{$includes:e}}},void 0),t||n.push({user:{nickname:{$includes:e}}}),e&&Number.isInteger(Number(e))&&n.push({[t?"id":"approvalId"]:{$eq:e}}),{$or:n}}const zA={ActionbarStyle:p.css`
217
217
  margin-bottom: 16px;
218
218
  `,TableV2Style:p.css`
219
219
  .ant-table-cell {
@@ -1,18 +1,18 @@
1
1
  module.exports = {
2
- "@tachybase/client": "1.0.6",
3
- "@tachybase/module-workflow": "1.0.6",
4
- "@tachybase/server": "1.0.6",
2
+ "@tachybase/client": "1.0.18",
3
+ "@tachybase/module-workflow": "1.0.18",
4
+ "@tachybase/server": "1.0.18",
5
5
  "lodash": "4.17.21",
6
6
  "react": "18.3.1",
7
- "@tachybase/schema": "1.0.6",
7
+ "@tachybase/schema": "1.0.18",
8
8
  "antd": "5.22.5",
9
- "@tachybase/actions": "1.0.6",
10
- "@tachybase/database": "1.0.6",
11
- "@tachybase/data-source": "1.0.6",
12
- "@tachybase/module-ui-schema": "1.0.6",
13
- "@tachybase/utils": "1.0.6",
9
+ "@tachybase/actions": "1.0.18",
10
+ "@tachybase/database": "1.0.18",
11
+ "@tachybase/data-source": "1.0.18",
12
+ "@tachybase/module-ui-schema": "1.0.18",
13
+ "@tachybase/utils": "1.0.18",
14
14
  "sequelize": "6.37.5",
15
- "@tachybase/components": "1.0.6",
15
+ "@tachybase/components": "1.0.18",
16
16
  "@ant-design/icons": "5.3.7",
17
17
  "ahooks": "3.8.4",
18
18
  "react-router-dom": "6.28.1"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-workflow-approval",
3
3
  "displayName": "Approval",
4
- "version": "1.0.6",
4
+ "version": "1.0.18",
5
5
  "description": "Approval base in Workflow",
6
6
  "keywords": [
7
7
  "Approval",
@@ -25,16 +25,17 @@
25
25
  "sequelize": "^6.37.5"
26
26
  },
27
27
  "peerDependencies": {
28
- "@tachybase/actions": "1.0.6",
29
- "@tachybase/components": "1.0.6",
30
- "@tachybase/client": "1.0.6",
31
- "@tachybase/data-source": "1.0.6",
32
- "@tachybase/database": "1.0.6",
33
- "@tachybase/schema": "1.0.6",
34
- "@tachybase/server": "1.0.6",
35
- "@tachybase/module-workflow": "1.0.6",
36
- "@tachybase/test": "1.0.6",
37
- "@tachybase/utils": "1.0.6"
28
+ "@tachybase/actions": "1.0.18",
29
+ "@tachybase/components": "1.0.18",
30
+ "@tachybase/client": "1.0.18",
31
+ "@tachybase/module-ui-schema": "1.0.18",
32
+ "@tachybase/data-source": "1.0.18",
33
+ "@tachybase/database": "1.0.18",
34
+ "@tachybase/module-workflow": "1.0.18",
35
+ "@tachybase/schema": "1.0.18",
36
+ "@tachybase/server": "1.0.18",
37
+ "@tachybase/test": "1.0.18",
38
+ "@tachybase/utils": "1.0.18"
38
39
  },
39
40
  "description.zh-CN": "审批系统是一个强大的BPM工具,为业务流程自动化提供基础支持,同时具备高度灵活性和可扩展性,确保审批流程的效率和合规性,助力企业释放创新潜力。",
40
41
  "displayName.zh-CN": "审批",