import{h as S}from"./moment.C5S46NFB.js";import{_ as g}from"./yb_admin_plugin.DNFUAscl.js";import{aZ as r,aL as p,u as c,v as h,I as l,bJ as n,H as x,F as z,aX as D,s as f,A as F,aY as v}from"./@vue.Da0bZ210.js";import{g as V}from"./reply.KzKATQCW.js";import"./element-plus.DC208N5p.js";import"./lodash-es.DVGGNlzX.js";import"./@vueuse.BhH-hw9p.js";import"./@element-plus.pQhr8KT1.js";import"./async-validator.9PlIezaS.js";import"./@popperjs.C5az9QE8.js";import"./@ctrl.C4Rzlq_k.js";import"./dayjs.BLMYetss.js";import"./memoize-one.BdPwpGay.js";import"./normalize-wheel-es.BQoi3Ox2.js";import"./@floating-ui.DCXYYTka.js";import"./pinia.Tngw-S_5.js";import"./vue-i18n.C7BagGww.js";import"./@intlify.TnaUIxGf.js";import"./vue-router.DaVMGKLh.js";import"./echarts.Dms41JYJ.js";import"./tslib.BDyQ-Jie.js";import"./zrender.BueMfJu3.js";const N={title:"选择素材",name:"RadioList",props:{radioList:{type:Array,default:function(){return[]}},getDateList:{type:[Promise,Function],default:function(){return null}}},data(){return{sendPeopleList:[],keyword:"",templateRadio:"",pageTotal:0,templateSelection:"",showList:[],layout:"total, sizes, prev, pager, next, jumper",total:0,queryForm:{type:"image",pageNo:1,pageSize:10}}},created(){this.fetchData()},methods:{getTemplateRow(e,t){this.templateSelection=t},search(){this.keyword.trim().length===0?this.showList=this.sendPeopleList:this.showList=this.sendPeopleList.filter(e=>{for(let t in e)if(`${e[t]}`.indexOf(this.keyword)>=0)return e})},handleSizeChange(e){this.queryForm.pageSize=e,this.fetchData()},handleCurrentChange(e){this.queryForm.pageNo=e,this.fetchData()},fetchData(){this.listLoading=!0,this.getDateList(this.queryForm).then(e=>{let t=e.data;this.sendPeopleList=t.list,this.showList=this.sendPeopleList,this.total=t.totalCount,setTimeout(()=>{this.listLoading=!1},300)})}}},q={class:"search"};function B(e,t,u,_,a,i){const d=r("el-input"),y=r("el-button"),w=r("el-radio"),L=r("el-radio-group"),m=r("el-table-column"),b=r("el-table"),C=r("el-pagination");return p(),c("div",null,[h("div",q,[l(d,{modelValue:a.keyword,"onUpdate:modelValue":t[0]||(t[0]=o=>a.keyword=o),modelModifiers:{trim:!0},class:"inpSearch",placeholder:"关键词筛选"},null,8,["modelValue"]),l(y,{type:"primary",onClick:i.search},{default:n(()=>[...t[2]||(t[2]=[x("搜索",-1)])]),_:1},8,["onClick"])]),l(b,{ref:"multipleTable",data:a.showList,style:{width:"100%"}},{default:n(()=>[l(m,{label:"",width:"40"},{default:n(o=>[l(L,{modelValue:a.templateRadio,"onUpdate:modelValue":t[1]||(t[1]=s=>a.templateRadio=s)},{default:n(()=>[l(w,{label:o.row.id,style:{"margin-left":"10px"},onChange:s=>i.getTemplateRow(o.$index,o.row)},{default:n(()=>[...t[3]||(t[3]=[h("span",null,null,-1)])]),_:1},8,["label","onChange"])]),_:2},1032,["modelValue"])]),_:1}),(p(!0),c(z,null,D(u.radioList,(o,s)=>(p(),f(m,{key:s,label:o.label,prop:o.prop,align:o.align||"left",width:o.width||"auto","show-overflow-tooltip":""},F({_:2},[o.prop?void 0:{name:"default",fn:n(k=>[v(e.$slots,o.label,{data:k.row},void 0,!0)]),key:"0"}]),1032,["label","prop","align","width"]))),128))]),_:3},8,["data"]),l(C,{background:"","current-page":a.queryForm.pageNo,"page-size":a.queryForm.pageSize,layout:a.layout,total:a.total,onSizeChange:i.handleSizeChange,onCurrentChange:i.handleCurrentChange},null,8,["current-page","page-size","layout","total","onSizeChange","onCurrentChange"])])}const P=g(N,[["render",B],["__scopeId","data-v-cda05cc6"]]),R={title:"素材选择",name:"Choose",components:{resource:P},props:{type:{type:String,default:""},gzh_id:{type:Number,default:0}},filters:{date(e){return S.unix(e).format("YYYY-MM-DD HH:mm:ss")}},data(){return{code:null,radioList:[{label:"素材名称",prop:"name",width:"500px",align:"center"},{label:"创建时间",prop:"create_time",align:"center"}]}},methods:{onSubmit(){this.callBack&&this.callBack(this.$refs.cm.templateSelection)},getDateList(e){return V({...e,type:this.type,id:this.gzh_id})}}};function T(e,t,u,_,a,i){const d=r("resource");return p(),f(d,{ref:"cm","get-date-list":i.getDateList,"radio-list":a.radioList},null,8,["get-date-list","radio-list"])}const le=g(R,[["render",T],["__scopeId","data-v-f5b558f6"]]);export{le as default};
