create-1c66cbea.js 5.1 KB

1
  1. /* empty css *//* empty css */import{_ as e}from"./index-3fa924ea.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as l}from"./myUpload-ca1eae66.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import a from"./videoList-b61e0e2f.js";import{d as s,R as t,ax as r,m as i,x as u,o,c as n,X as d,f as m,l as p,w as c,a as f,F as v,y as b,e as g,ba as _,z as y,b as j,t as h,a7 as V,a5 as x,A as w,B as S,a4 as U,a3 as k,J as q,U as O,ar as C,Z as J,a0 as L,_ as z}from"./index-189c105d.js";import{h as M}from"./http-fee0c3f6.js";import{o as N}from"./index-535903c9.js";/* empty css *//* empty css */function $(e,l){return M.post(`/operation/banner/editStatus/${e}`,l)}function F(e,l){return M.post(`/operation/banner/del/${e}`,l)}const T={key:0,class:"flex flex-wrap items-center mb-5"},B={class:"flex justify-end"},I=z(s({__name:"create",props:{primary:Object},emits:["close"],setup(s,{emit:z}){const $=s;t(),r();const F=i(!1),I=i(!1);i("");const P=i(),R=i({}),Z=i([]),A=()=>{R.value.duanjus=""},E=e=>{R.value.img_url=e},G=e=>{R.value.img_url=""},H=()=>{I.value=!0},K=e=>{R.value.duanjus=e,I.value=!1},X=e=>{R.value,e&&(F.value=!0,e.validate((e=>{var l,a;if(e){const e={title:R.value.title,video_id:null==(l=R.value.duanjus)?void 0:l.id,miniprogram_type:R.value.miniprogram_type,sort:R.value.sort,img_url:R.value.img_url,status:R.value.status};(null==(a=$.primary)?void 0:a.id)?function(e,l){return M.post(`/operation/banner/edit/${e}`,l)}(R.value.id,e).then((e=>{x.success(e.message),z("close")})):function(e){return M.post("/operation/banner/add",e)}(e).then((e=>{x.success(e.message),z("close")})),F.value=!1}else F.value=!1})).then((()=>{})))};return $.primary.id?(R.value=JSON.parse(JSON.stringify($.primary)),R.value.duanjus=JSON.parse(JSON.stringify($.primary.videoInfo)),R.value.fileList=[{uid:$.primary.id,url:$.primary.img_url}],$.primary,R.value):R.value.fileList=[],u((()=>{N().then((e=>{Z.value=e.data.miniprogramType}))})),(s,t)=>{const r=w,i=S,u=U,x=k,z=l,M=q,N=O,$=C,D=J,Q=e,W=L;return o(),n(v,null,[d((o(),p(D,{model:m(R),"label-width":"120px",ref_key:"form",ref:P,class:"pr-4"},{default:c((()=>[f(u,{label:"小程序类型",prop:"miniprogram_type",rules:[{required:!0,message:"选择小程序类型"}],"label-width":"120px"},{default:c((()=>[f(i,{modelValue:m(R).miniprogram_type,"onUpdate:modelValue":t[0]||(t[0]=e=>m(R).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:c((()=>[(o(!0),n(v,null,b(m(Z),((e,l)=>(o(),p(r,{key:l,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),f(u,{label:"轮播图名称",prop:"title",rules:[{required:!0,message:"轮播图名称必须填写"}],"label-width":"120px"},{default:c((()=>[f(x,{modelValue:m(R).title,"onUpdate:modelValue":t[1]||(t[1]=e=>m(R).title=e),size:"default",clearable:""},null,8,["modelValue"])])),_:1}),f(u,{label:"排序",prop:"sort",rules:[{required:!0,message:"排序必须填写"}],"label-width":"120px"},{default:c((()=>[f(x,{modelValue:m(R).sort,"onUpdate:modelValue":t[2]||(t[2]=e=>m(R).sort=e),modelModifiers:{number:!0},min:"1",type:"number",size:"default",clearable:""},null,8,["modelValue"])])),_:1}),f(u,{label:"封面图",prop:"img_url",rules:[{required:!0,message:"请上传封面图"}]},{default:c((()=>[f(z,{acceptType:".png,.jpg,.jpeg",isCheckMM:!1,isMultiple:!1,onFileRemove:G,onFileSuccess:E,fileList:m(R).fileList,action:"/qiniu/upload/image"},null,8,["fileList"])])),_:1}),f(u,{label:"链接短剧信息",prop:"duanjus",rules:[{required:!1,message:"选择链接短剧信息",trigger:"change"}]},{default:c((()=>{var e,l;return[g("div",null,[(null==(l=null==(e=m(R))?void 0:e.duanjus)?void 0:l.name)?(o(),n("div",T,[f(x,{modelValue:m(R).duanjus.name,"onUpdate:modelValue":t[3]||(t[3]=e=>m(R).duanjus.name=e),disabled:"",placeholder:"短剧名称",style:{width:"200px"},class:"input-with-select"},null,8,["modelValue"]),f(M,{class:"ml-3 cursor-pointer",onClick:A},{default:c((()=>[f(m(_))])),_:1})])):y("",!0),g("div",null,[f(N,{type:"primary",size:"default",onClick:H},{default:c((()=>[j("选择短剧")])),_:1})])])]})),_:1}),f(u,{label:"状态",prop:"status","label-width":"120px",rules:[{required:!0,message:"选择状态"}]},{default:c((()=>[f($,{modelValue:m(R).status,"onUpdate:modelValue":t[4]||(t[4]=e=>m(R).status=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])])),_:1}),g("div",B,[f(N,{type:"primary",onClick:t[5]||(t[5]=e=>X(m(P)))},{default:c((()=>[j(h(s.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[W,m(F)]]),f(Q,{modelValue:m(I),"onUpdate:modelValue":t[6]||(t[6]=e=>V(I)?I.value=e:null),title:"选择短剧",width:"90%",alignCenter:!0,"destroy-on-close":""},{default:c((()=>[f(a,{onConfirm:K,primary:m(R).duanjus},null,8,["primary"])])),_:1},8,["modelValue"])],64)}}}),[["__scopeId","data-v-eb677b73"]]),P=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"}));export{F as a,P as b,I as c,$ as o};