System.register(["./vendor-legacy-2701520b.js","./index-legacy-2b663974.js"],(function(e,t){"use strict";var n,i,o,c,a,s=document.createElement("style");return s.textContent=".clues-checking[data-v-a6444d7f]{background-color:#fff;border-radius:8px;padding:10px}.clues-checking .el-form[data-v-a6444d7f]{padding:20px}.clues-checking .tips[data-v-a6444d7f]{margin-left:20px;font-size:14px;color:#999}.clues-checking .condition[data-v-a6444d7f]{margin-bottom:10px}.clues-checking .guide[data-v-a6444d7f]{width:100%;display:flex;flex-direction:column;align-items:center;margin-top:40px}.clues-checking .guide .setp[data-v-a6444d7f]{margin-top:15px;font-size:14px;color:#919398;display:flex;align-items:center}.clues-checking .guide .setp img[data-v-a6444d7f]{margin:5px 10px 0}\n",document.head.appendChild(s),{setters:[function(e){n=e.i,i=e.r,o=e.o},function(e){c=e.n,a=e.$}],execute:function(){e("default",c({__name:"cluesChecking",setup:function(e){var t=n({id:"",is_open:!0,condition:[]}),c=i(),s=n({}),r=i([]);function l(){HTTP.getRead("check_repeat",{type:1}).then((function(e){if(e.data.count){var n=e.data.results[0];t.id=n.id,t.is_open=1===n.clue_check_repeat,t.condition=n.keys.split(",").map((function(e){return{key:e}}))}}))}function d(){HTTP.get("templates_config",{key:"clue_customer_temp"}).then((function(e){r.value=JSON.parse(e.data.results[0].field_json)}))}function u(){var e=t.condition.map((function(e){return e.key})),n={id:t.id,type:1,company:a.getters.company,keys:e.join(",")};t.id?HTTP.patch("check_repeat",n):(delete n.id,HTTP.post("check_repeat",n).then((function(e){l()})))}return o((function(){l(),d()})),{__sfc:!0,form:t,formRef:c,rules:s,conditionList:r,getData:l,getCondition:d,addCondition:function(){t.condition.push({key:""})},editCompany:function(){HTTP.patch("company",{id:a.getters.company,clue_check_repeat:t.is_open?1:0})},saveCondition:u,deleteKey:function(e){t.condition.splice(e,1),u()}}}},(function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"clues-checking"},[t("el-form",{ref:"formRef",attrs:{model:n.form,rules:n.rules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"查重开关："}},[t("el-switch",{directives:[{name:"permission",rawName:"v-permission",value:34601,expression:"34601"}],on:{change:n.editCompany},model:{value:n.form.is_open,callback:function(t){e.$set(n.form,"is_open",t)},expression:"form.is_open"}}),t("span",{staticClass:"tips"},[e._v(" 查重开关打开后，重复信息将无法录入系统 ")])],1),t("el-form-item",{attrs:{label:"查重条件："}},e._l(n.form.condition,(function(i,o){return t("div",{key:o,staticClass:"condition"},[t("el-select",{staticStyle:{width:"200px"},attrs:{placeholder:"请选择"},on:{change:n.saveCondition},model:{value:i.key,callback:function(t){e.$set(i,"key",t)},expression:"item.key"}},e._l(n.conditionList,(function(e){return t("el-option",{key:e.key,attrs:{label:e.name,value:e.key}})})),1),t("el-button",{attrs:{type:"text",icon:"el-icon-delete",circle:""},on:{click:function(e){return n.deleteKey(o)}}})],1)})),0),t("el-form-item",{attrs:{label:"查重条件："}},[t("el-button",{directives:[{name:"permission",rawName:"v-permission",value:34602,expression:"34602"}],attrs:{type:"primary"},on:{click:function(e){return n.addCondition()}}},[e._v("新增条件")])],1)],1)],1)}),[],!1,null,"a6444d7f",null,null).exports)}}}));
