import{e,a9 as a,r as t,aa as s,f as n,g as r,h as o,w as i,K as m,x as l,z as p,o as d,i as u,_ as c,aq as _}from"./index-B3cqKsI_.js";import{_ as h}from"./uni-search-bar.BeJhs2X5.js";import{c as x}from"./customerListDefault.CzG8Idww.js";import{c as b}from"./customerTab.Bjv0Z6Hl.js";import{d as y}from"./assessment.C7cFhOQt.js";import{d as f}from"./customer.Crnb53sL.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.EqO7jntL.js";/* empty css */import"./uni-row.DyJ89Jxj.js";import"./uni-dateformat.DQ4pg8Wo.js";import"./uni-list.zT2ADjW3.js";import"./uni-badge.D3PXVPFA.js";import"./customer-lost.DHTY2quF.js";import"./index.GhHyI8tz.js";/* empty css */import"./index.RiVy64xs.js";import"./default-avatar.BAKNUlXW.js";/* empty css */const w=j({__name:"search",setup(j){const w=e({typeIndex:0,tabIndex:0,placeholder:"搜索客户名称",examineTabData:y,listData:[],emptyTitle:"暂无搜索结果~",where:{limit:10,page:1,types:1,customer_name:""}});a((e=>{const a=w.examineTabData.length-1;e.type&&(w.where.types=e.type),e.index&&(e.index>a?w.tabIndex=a:w.tabIndex=Number(e.index))}));const g=()=>{w.where.customer_name="",w.listData=[]},v=()=>{c()},D=()=>{w.where.page=1,w.where.customer_name?T(!0):g()},I=e=>{w.where.page>1&&_(),w.tabIndex=e.index,w.where.page=1,"我查看的"===e.name?w.where.types=1:"我负责的"===e.name?w.where.types=2:w.where.types=3,w.where.customer_name?T(!0):g()},T=(e=!1)=>{const a=w.examineTabData[w.tabIndex].id;w.typeIndex=Number(a),F(e)},C=t(!1),F=(e=!1)=>{f(w.where).then((a=>{e&&(w.listData=[]),w.listData.push(...a.data.list);const t=Math.ceil(a.data.count/w.where.limit);w.listData.length<=0||w.where.page>=t?C.value=!1:C.value=!0,m()})).catch((e=>{l.error(e.message)}))};return s((()=>{C.value&&(w.where.page++,F())})),(e,a)=>{const t=p,s=n(r("uni-search-bar"),h);return d(),o(t,{class:"content"},{default:i((()=>[u(t,{class:"cr-position-header"},{default:i((()=>[u(t,{class:"status_bar"}),u(t,{class:"default-search"},{default:i((()=>[u(s,{onConfirm:D,onFocus:D,placeholder:w.placeholder,focus:!0,bgColor:"#F0F1F5",modelValue:w.where.customer_name,"onUpdate:modelValue":a[0]||(a[0]=e=>w.where.customer_name=e),onClear:g,onCancel:v},null,8,["placeholder","modelValue"])])),_:1}),u(b,{"examine-tab-data":w.examineTabData,onChange:I,index:w.tabIndex},null,8,["examine-tab-data","index"])])),_:1}),u(t,{class:"examine-content m10"},{default:i((()=>[u(x,{"list-data":w.listData,"type-index":w.typeIndex,"empty-title":w.emptyTitle},null,8,["list-data","type-index","empty-title"])])),_:1})])),_:1})}}},[["__scopeId","data-v-9279d6a2"]]);export{w as default};