import{r as e,b as a,a2 as n,e as t,f as l,g as i,a as s,o,h as d,w as r,k as f,F as u,l as c,i as _,j as m,t as y,N as p,m as k,_ as g,y as v,z as b,O as x}from"./index-WeUkftbp.js";import{_ as O,a as h}from"./uni-row.DLutFlIQ.js";import{_ as j}from"./uni-dateformat.CAFQ6hZt.js";import{e as w}from"./index.D8Jasx-l.js";import{d as C}from"./index.C5LIx7aw.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";const F=D({__name:"item",props:{tableData:{type:Array,default:[]},info:{type:Object,default:{}},type:{type:String,default:""},keyName:{type:String,default:""},tableName:{type:String,default:""}},emits:["selectFn"],setup(D,{emit:F}){const S=e(null);let N=a();const I=D,{info:L,tableData:z,keyName:A,type:$,tableName:M}=n(I),J=t({ids:[],activeData:N.state.app.oneOnOneData,btnList:[{icon:"iconfont icon-gongzuohuibao-bianji",type:1,name:"编辑"},{icon:"iconfont icon-shanchu",type:2,name:"删除"}]}),K=(e,a,n)=>{let t="";return t=""==a?"--":"cascader_address"===n.form_value||"cascader_radio"==n.form_value?a.join("/"):Array.isArray(a)?a.toString():"checkbox"==n.form_value?a.join(","):"input_select"==n.form_value?a.name:a,t||"--"};let P=F;const Q=(e,a)=>{let n={id:e.id,name:e[L.value.index_field_name]};J.activeData=n,N.commit("setoneOnOneData",n),g()};return(e,a)=>{const n=v,t=b,g=l(i("uni-col"),O),D=l(i("uni-row"),h),F=x,N=l(i("uni-dateformat"),j);return s(z).length>0?(o(),d(t,{key:0,class:"list-content"},{default:r((()=>[(o(!0),f(u,null,c(s(z),((a,l)=>(o(),d(t,{class:"list",key:l},{default:r((()=>[_(t,null,{default:r((()=>[(o(!0),f(u,null,c(s(L).showField||s(L).association_field,((l,i)=>(o(),d(D,{class:"list-info",key:i,onClick:e=>(e=>{if("oneOnOne"==$.value||"detail"==$.value)return!1;let a=e[L.value.crudInfo.main_field_name]||"查看",n=M.value?M.value:A.value;k(`/pages/module/details?id=${e.id}&key=${n}&&name=${a}`)})(a)},{default:r((()=>[l.field_name_en==("oneOnOne"==s($)?s(L).index_field_name:s(L).crudInfo.main_field_name)?(o(),d(t,{key:0,class:"title"},{default:r((()=>[_(n,{style:{width:"80%"},class:"over-text"},{default:r((()=>[m(y(a[l.field_name_en]||"--"),1)])),_:2},1024),"oneOnOne"!==s($)?(o(),d(C,{key:0,ref_for:!0,ref_key:"deanPopoverRef",ref:S,"model-direction":"right",btnList:J.btnList,onSelect:e=>{return n=e,t=a.id,void P("selectFn",n,t);var n,t}},{icon:r((()=>[_(n,{class:"iconfont icon-yunwenjian-gengduo"})])),_:2},1032,["btnList","onSelect"])):(o(),f(u,{key:1},[J.activeData.id==a.id?(o(),d(t,{key:0,class:"iconfont icon-denglu-tongyi",onClick:e=>Q(a)},null,8,["onClick"])):(o(),d(t,{key:1,class:"iconfont icon-xuanzeanniu-weixuan",onClick:e=>Q(a)},null,8,["onClick"]))],64))])),_:2},1024)):p("",!0),l.field_name_en!==("oneOnOne"==s($)?s(L).index_field_name:s(L).crudInfo.main_field_name)?(o(),f(u,{key:1},[_(g,{span:7,pull:1,class:"text-right info-item-left"},{default:r((()=>[m(y(l.field_name),1)])),_:2},1024),_(g,{span:17,class:"info-item-right"},{default:r((()=>["image"===l.form_value?(o(),d(t,{key:0,class:"imgFlex"},{default:r((()=>[(o(!0),f(u,null,c(a[l.field_name_en],((a,n)=>(o(),f("img",{class:"img",src:a.url,alt:"",key:n,onClick:n=>e.preview(a)},null,8,["src","onClick"])))),128))])),_:2},1024)):"tag"===l.form_value?(o(),d(t,{key:1,class:"imgFlex"},{default:r((()=>[(o(!0),f(u,null,c(a[l.field_name_en],((e,a)=>(o(),d(t,{class:"tag"},{default:r((()=>[m(y(e),1)])),_:2},1024)))),256))])),_:2},1024)):"switch"===l.form_value?(o(),d(t,{key:2},{default:r((()=>[_(t,null,{default:r((()=>[m(y(1==a[l.field_name_en]?"是":"否"),1)])),_:2},1024)])),_:2},1024)):(o(),d(n,{key:3},{default:r((()=>[m(y(K(0,a[l.field_name_en],l)),1)])),_:2},1024))])),_:2},1024)],64)):p("",!0)])),_:2},1032,["onClick"])))),128))])),_:2},1024),"oneOnOne"!==s($)?(o(),d(t,{key:0,class:"footer"},{default:r((()=>[_(t,{class:"left"},{default:r((()=>[_(F,{class:"img",src:a.owner_user.avatar,mode:""},null,8,["src"]),m(" "+y(a.owner_user.name)+" 负责 ",1)])),_:2},1024),_(t,{class:"left"},{default:r((()=>[_(n,{class:"info-item-left mr8"},{default:r((()=>[m("创建于")])),_:1}),_(N,{format:"yyyy/MM/dd",date:a.created_at},null,8,["date"])])),_:2},1024)])),_:2},1024)):p("",!0)])),_:2},1024)))),128))])),_:1})):(o(),d(w,{key:1,index:7,title:"暂无数据"}))}}},[["__scopeId","data-v-8b8703eb"]]);export{F as i};
