1 |
- import{aJ as D,aK as M,b as O,p as m,k as y,o as p,c as f,j as r,f as e,A as u,a as c,F as _,r as E,h as b,l as C,t as k,aM as j,K as N,L as z}from"./index.4d3e3847.js";import{_ as G}from"./page-search.vue_vue_type_script_setup_true_lang.e284bf07.js";import{u as K}from"./use-page-search.da34a19a.js";import{h as T}from"./company.a05c4b39.js";import{h as U}from"./card.8fd03846.js";import{c as W,u as J,_ as X}from"./use-page-modal.6d6e7705.js";import{P as Y}from"./page-content.1fdb6363.js";import"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{_ as H}from"./Video.vue_vue_type_script_setup_true_lang.6fefb1f4.js";import{_ as Q}from"./ComCard.vue_vue_type_script_setup_true_lang.96e3560a.js";import{B as Z}from"./basic-form.114da3ff.js";import"./hooks.428ba1c3.js";import"./useNav.afbe69e0.js";import"./index.a5d44002.js";import"./responseHandle.db1518c7.js";import"./useAsync.24db85a6.js";import"./xlsx.ed122d16.js";import"./remoteSelect.9c029262.js";import"./validate.93ab4ac7.js";import"./image.7849d972.js";const ee={formItems:[{field:"timer",type:"date_picker",otherOptions:{type:"daterange",startProp:"start_date",endProp:"end_date",startPlaceholder:"\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4"}},{field:"company_title",type:"input",placeholder:"\u4F01\u4E1A\u540D\u79F0"},{field:"card_title",type:"input",placeholder:"\u5361\u7C7B\u578B"},{field:"code",type:"input",placeholder:"\u7F16\u7801"}]},A=ee,{VITE_PROXY_DOMAIN_REAL:P}=M();async function te(n={}){return D.request("post",`${P}admin/videoGroupAdd`,{data:n})}async function oe(n={}){return D.request("post",`${P}admin/videoGroupList`,{data:n})}const ae=[{type:"selection",width:55,hide:({checkList:n})=>!n.includes("\u52FE\u9009\u5217")},{type:"expand",slot:"expand"},{prop:"code",label:"\u8BB0\u5F55\u7F16\u7801"},{prop:"company_title",label:"\u516C\u53F8\u540D\u79F0"},{prop:"card_title",label:"\u5361\u7C7B\u578B"},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",sortable:!0}],ue={title:"\u6279\u91CF\u8BBE\u7F6E\u89C6\u9891",columns:ae,apis:{httpAdd:te,httpList:oe}},ie=ue,re={title:"\u4F01\u4E1A\u5546\u54C1",colLayout:{span:24},itemStyle:{},contact:"batchSetVideo",labelWidth:"85px",formItems:[{field:"name",type:"remote-select",label:"\u4E1A\u52A1\u4F01\u4E1A",placeholder:"\u4E1A\u52A1\u4F01\u4E1A",otherOptions:{api:T,responseLabelProp:"title",responseValPro:"id",requesetProp:"",isRoot:!1,prop:"list"},span:24,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u4E1A\u52A1\u4F01\u4E1A"}]},{field:"name2",type:"remote-select",label:"\u5361\u7C7B\u578B",placeholder:"\u5361\u7C7B\u578B",otherOptions:{api:U,responseLabelProp:"title",responseValPro:"id",requesetProp:"",isRoot:!1,prop:"list"},span:24,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5361\u7C7B\u578B"}]}]},ne=re,x={labelWidth:"85px",formItems:[{label:"\u516C\u53F8\u5361\u7C7B\u578B",field:"group_id",placeholder:"\u516C\u53F8\u5361\u7C7B\u578B",span:24,slot:"group_id"},{label:"\u76F4\u64AD\u89C6\u9891",field:"video_ids",placeholder:"\u76F4\u64AD\u89C6\u9891",span:24,type:"array",slot:"video_ids"}]},le={group_id:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u516C\u53F8\u5361\u7C7B\u578B"},video_ids:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u76F4\u64AD\u89C6\u9891"}},se={style:{padding:"5px 55px"}},de={style:{width:"100%",padding:"0 0 15px 0"}},pe={style:{width:"50%"}},ce={class:"w-full flex justify-end"},Le=O({__name:"index",setup(n){const{formItems:R}=x,o=m(W(R)),h=m(null),g=m(""),{pageContentRef:B,handleResetClick:V,handleSearchClick:$}=K(void 0,void 0,A),{pageModalRef:L,handleCreateData:q,handleConfrim:F,defaultInfo:w}=J({pageContentRef:B});function I(){h.value.validate(l=>{if(!l)return;const{video_ids:a}=o.value,i=e(o);let s=[];a.forEach(t=>{s.push(t.id)}),i.video_ids=s,F("create",i)})}function S(l){if(l){const{id:a,video_name:i}=l;o.value.video_ids.findIndex(t=>t.id+""==a+"")==-1&&o.value.video_ids.push({id:a,video_name:i})}}return(l,a)=>{const i=y("el-tag"),s=y("ElButton");return p(),f(_,null,[r(e(G),{"form-config":e(A),onSearchBtnClick:e($),onResetBtnClick:e(V)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),r(e(Y),{ref_key:"pageContentRef",ref:B,"content-config":e(ie),onCreateBtnClick:e(q)},{expand:u(({video_name:t})=>[c("div",se,[(p(!0),f(_,null,E(t,(d,v)=>(p(),b(i,{"disable-transitions":"",key:d+v,size:"mini"},{default:u(()=>[C(k(d),1)]),_:2},1024))),128))])]),_:1},8,["content-config","onCreateBtnClick"]),r(e(X),{ref_key:"pageModalRef",ref:L,"modal-config":e(ne),"default-info":e(w),onConfirmBtnClick:e(F)},{default:u(()=>[r(e(Z),j({ref_key:"basicFormRef",ref:h},e(x),{"form-data":o.value,rules:e(le),disabled:!1,"label-width":"120px"}),{group_id:u(()=>[r(e(Q),{modelValue:o.value.group_id,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value.group_id=t),placeholder:"\u516C\u53F8\u5361\u7C7B\u578B"},null,8,["modelValue"])]),video_ids:u(()=>[N(c("div",de,[(p(!0),f(_,null,E(o.value.video_ids,(t,d)=>(p(),b(i,{key:t.id+d,class:"mx-1","disable-transitions":"",closable:"",size:"large",onClose:v=>o.value.video_ids.splice(d,1)},{default:u(()=>[C(k(t.video_name),1)]),_:2},1032,["onClose"]))),128))],512),[[z,o.value.video_ids&&o.value.video_ids.length>0]]),c("div",pe,[r(e(H),{modelValue:g.value,"onUpdate:modelValue":a[1]||(a[1]=t=>g.value=t),placeholder:"\u8BF7\u9009\u62E9\u76F4\u64AD\u89C6\u9891",onChange:S},null,8,["modelValue"])])]),footer:u(()=>[c("div",ce,[r(s,{type:"primary",onClick:I},{default:u(()=>[C("\u4FDD\u5B58")]),_:1})])]),_:1},16,["form-data","rules"])]),_:1},8,["modal-config","default-info","onConfirmBtnClick"])],64)}}});export{Le as default};
|