System.register(["./index-legacy.90883ee8.js","./vendor-legacy.bbc7855f.js"],(function(e){"use strict";var t,n,a,l,i,d,u,r,o,c,s,f,_,v,m,p,y,b,g,h,x,k,I,w,C,F;return{setters:[function(e){t=e.s,n=e.r},function(e){a=e.d,l=e.k,i=e.o,d=e.J,u=e.r,r=e.F,o=e.c,c=e.b,s=e.W,f=e.X,_=e.B,v=e.Y,m=e.Z,p=e.$,y=e.V,b=e.Q,g=e.H,h=e.K,x=e.x,k=e.I,I=e.O,w=e.P,C=e.T,F=e.m}],execute:function(){var D={add:"新增",modify:"修改",delete:"删除",none:""};e("default",a({name:"ProductDataSet",setup:function(){var e=l();console.log("route:: ",e),i((function(){t.dispatch("dataset/getDatasetFields",{dataset_id:e.query.dataset_id,page_size:10,page_index:1})}));var a=d([]),q=d("none"),z=d(""),O=u({id:0,field_name:"",field_type:0,field_describe:""}),S=u({field_name:[{required:!0,message:"请输入字段名称"}],field_type:[{required:!0,message:"请输入字段类型"}],field_describe:[{required:!0,message:"请输入字段说明"}]}),T=r.useForm(O,S),R=T.resetFields,U=T.validate,j=T.validateInfos,K=(T.mergeValidateInfo,function(){R(),q.value="add"}),P=function(e){console.log("delete item:: ",e);var n=e instanceof Array?e:[e.id];b.confirm({title:"确定要删除吗？",okText:"确定",cancelText:"取消",onOk:function(){t.dispatch("dataset/deleteDatasetFields",{list_id:n})}})},V=[{title:"ID",dataIndex:"id",resizable:!0,width:50},{title:"所属数据集",dataIndex:"dataset_id",resizable:!0,width:200,customRender:function(t){return t.record,o(g,null,[e.query.dataset_name])}},{title:"字段名称",dataIndex:"field_name"},{title:"字段类型",dataIndex:"field_type",customRender:function(e){var t=e.record;return o(g,null,[0==t.field_type?"数字":"字符串"])}},{title:"说明",dataIndex:"field_describe"},{title:"创建时间",dataIndex:"create_time",resizable:!0,width:200},{key:"action",title:"操作",width:135,customRender:function(e){var t=e.record;return o(g,null,[o(_,{size:"small",type:"primary",style:{margin:"0 5px 5px 0"},onClick:function(){return e=t,O.field_name=e.field_name,O.field_type=e.field_type,O.field_describe=e.field_describe,O.id=e.id,void(q.value="modify");var e}},{default:function(){return[c("修改")]}}),o(_,{size:"small",type:"ghost",danger:!0,onClick:function(){return P(t)}},{default:function(){return[c("删除")]}})])}}];return function(){return o(g,null,[o("h2",{class:"title"},[c("字段配置管理"),o(s,{onSearch:function(e){z.value=e},class:"title-search",placeholder:"请输入字段名称"},null)]),o(f,null,null),o("div",{class:"table"},[o(_,{type:"ghost",danger:!0,icon:o(v,null,null),class:"table-delete ".concat(0==a.value.length?"hidden":""),onClick:function(){return P(a.value)}},{default:function(){return[c("删除")]}}),o(_,{type:"primary",icon:o(m,null,null),class:"table-add",onClick:K},{default:function(){return[c("新增")]}}),o(_,{type:"ghost",icon:o(p,null,null),class:"table-back",onClick:function(){return n.back()}},{default:function(){return[c("返回")]}}),o(y,{rowKey:"id",bordered:!0,loading:t.state.dataset.loading,columns:V,dataSource:(l=t.state.dataset.datasetsFields,z.value?l.filter((function(e){return e.field_name.indexOf(z.value)>-1})):l),rowSelection:{onChange:function(e){a.value=e}}},null)]),o(b,{title:function(){return o(g,null,[o("strong",null,[D[q.value]]),c(" 字段集配置")])},width:800,visible:"none"!=q.value,closable:!0,onOk:function(){console.log("itemData:: ",O),U().then((function(){O.dataset_id=parseInt(e.query.dataset_id),0==O.id?t.dispatch("dataset/postDatasetField",O):t.dispatch("dataset/putDatasetField",O),q.value="none"})).catch((function(e){F.warn("表单字段填写有误，请检查后再次提交")}))},okText:"确定",cancelText:"取消",onCancel:function(){return q.value="none"},destroyOnClose:!1},{default:function(){return[o(r,{name:"field"},{default:function(){return[o(h,x({label:"字段名称"},j.field_name),{default:function(){return[o(k,{value:O.field_name,"onUpdate:value":function(e){return O.field_name=e}},null)]}}),o(h,x({label:"字段类型"},j.field_type),{default:function(){return[o(I,{value:O.field_type,"onUpdate:value":function(e){return O.field_type=e}},{default:function(){return[o(w,{value:0},{default:function(){return[c("数字")]}}),o(w,{value:1},{default:function(){return[c("字符串")]}})]}})]}}),o(h,x({label:"字段信息"},j.field_describe),{default:function(){return[o(C,{value:O.field_describe,"onUpdate:value":function(e){return O.field_describe=e}},null)]}})]}})]}})]);var l}}}))}}}));
