import{r as a,i}from"./vendor-39c32a1b.js";import{n as _}from"./index-8fa791df.js";const f={__name:"customFieldDialog",emits:["saveCustomField"],setup(u,{expose:r,emit:l}){const e=a(!1),t=a(),o=i({name:"",key:"custom",type:"",dropdown_value:"",length_limit:10,is_required:!1}),c=i({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u6BB5\u540D\u79F0",trigger:"blur"}],type:[{required:!0,message:"\u8BF7\u9009\u5B57\u6BB5\u7C7B\u578B",trigger:"change"}],dropdown_value:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u6BB5\u503C",trigger:"blur"}],length_limit:[{required:!0,message:"\u8BF7\u8F93\u5165\u6700\u5927\u5B57\u6570",trigger:"blur"}]}),m=a([{name:"\u5355\u884C\u6587\u672C",value:"input"},{name:"\u591A\u884C\u6587\u672C",value:"text"},{name:"\u6570\u5B57",value:"number"},{name:"\u4E0B\u62C9\u6846",value:"select"},{name:"\u65E5\u671F",value:"date"},{name:"\u65E5\u671F\u533A\u95F4",value:"dateRange"}]);function n(){s(),e.value=!0}function s(){o.name="",o.type="",o.dropdown_value=""}function p(){t.value.validate(d=>{if(d)l("saveCustomField",o),e.value=!1;else return!1})}return r({init:n}),{__sfc:!0,transferDialogVisible:e,emits:l,clueFormRef:t,clueForm:o,clueRules:c,optionList:m,init:n,resetForm:s,saveField:p}}};var v=function(){var r=this,l=r._self._c,e=r._self._setupProxy;return l("el-dialog",{attrs:{"append-to-body":!0,title:"\u81EA\u5B9A\u4E49\u5B57\u6BB5","close-on-click-modal":!1,visible:e.transferDialogVisible,width:"500px"},on:{"update:visible":function(t){e.transferDialogVisible=t}}},[l("div",{staticStyle:{padding:"5px 25px 5px 0"}},[l("el-form",{ref:"clueFormRef",attrs:{model:e.clueForm,rules:e.clueRules,"label-width":"90px"}},[l("el-form-item",{attrs:{label:"\u5B57\u6BB5\u540D\u79F0",prop:"name"}},[l("el-input",{model:{value:e.clueForm.name,callback:function(t){r.$set(e.clueForm,"name",t)},expression:"clueForm.name"}})],1),l("el-form-item",{attrs:{label:"\u7C7B\u578B",prop:"type"}},[l("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"\u8BF7\u9009\u62E9"},model:{value:e.clueForm.type,callback:function(t){r.$set(e.clueForm,"type",t)},expression:"clueForm.type"}},r._l(e.optionList,function(t){return l("el-option",{key:t.value,attrs:{label:t.name,value:t.value}})}),1)],1),["input","text"].includes(e.clueForm.type)?l("el-form-item",{attrs:{label:"\u6700\u5927\u5B57\u6570",prop:"length_limit"}},[l("el-input",{model:{value:e.clueForm.length_limit,callback:function(t){r.$set(e.clueForm,"length_limit",t)},expression:"clueForm.length_limit"}})],1):r._e(),["select"].includes(e.clueForm.type)?l("el-form-item",{attrs:{label:"\u4E0B\u62C9\u9009\u9879",prop:"dropdown_value"}},[l("el-input",{attrs:{type:"textarea",rows:2,placeholder:"\u8BF7\u8F93\u5165\u4E0B\u62C9\u7684\u503C\uFF0C\u5E76\u7528\u201C\u3001\u201D\u9694\u5F00"},model:{value:e.clueForm.dropdown_value,callback:function(t){r.$set(e.clueForm,"dropdown_value",t)},expression:"clueForm.dropdown_value"}})],1):r._e(),l("el-form-item",{attrs:{label:""}},[l("el-checkbox",{model:{value:e.clueForm.is_required,callback:function(t){r.$set(e.clueForm,"is_required",t)},expression:"clueForm.is_required"}},[r._v("\u8BBE\u4E3A\u5FC5\u586B")])],1)],1)],1),l("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[l("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.saveField()}}},[r._v("\u4FDD \u5B58")]),l("el-button",{on:{click:function(t){e.transferDialogVisible=!1}}},[r._v("\u53D6 \u6D88")])],1)])},g=[],F=_(f,v,g,!1,null,"4a66b5ed",null,null);const x=F.exports;export{x as c};
