1 |
- import{bs as x,aJ as h,aK as V,b as W,p as f,k as y,o as F,c as b,j as p,f as a,A as l,aM as L,a as d,t as c,K as N,L as T,F as E,r as U,h as j,l as A}from"./index.4d3e3847.js";import{_ as H}from"./page-search.vue_vue_type_script_setup_true_lang.e284bf07.js";import{u as K}from"./use-page-search.da34a19a.js";import{c as z,r as J,t as X}from"./column-helper.adef10ea.js";import{c as G,u as Q,_ as Z,t as ee}from"./use-page-modal.6d6e7705.js";import{P as ue}from"./page-content.1fdb6363.js";import{u as te}from"./useAsync.24db85a6.js";import{g as ae,h as ie,e as oe,f as le}from"./validate.93ab4ac7.js";import{B as re}from"./basic-form.114da3ff.js";import"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{_ as ne}from"./Video.vue_vue_type_script_setup_true_lang.6fefb1f4.js";import"./hooks.428ba1c3.js";import"./useNav.afbe69e0.js";import"./index.a5d44002.js";import"./responseHandle.db1518c7.js";import"./xlsx.ed122d16.js";import"./image.7849d972.js";import"./remoteSelect.9c029262.js";const se={formItems:[{field:"status",type:"select",placeholder:"\u8D26\u53F7\u72B6\u6001",options:z(x)},{field:"username",type:"input",placeholder:"\u8D26\u53F7"},{field:"nickname",type:"input",placeholder:"\u5BA2\u6237\u59D3\u540D"},{field:"mobile",type:"input",placeholder:"\u5BA2\u6237\u624B\u673A\u53F7"}]},k=se,{VITE_PROXY_DOMAIN_REAL:_}=V();async function de(o){return h.request("post",`${_}admin/AccoountList`,{data:o})}async function pe(o){return h.request("post",`${_}admin/AccoountRead`,{data:o})}async function ce(o){return h.request("post",`${_}admin/AccoountEdit`,{data:o})}const me=[{type:"selection",width:55,hide:({checkList:o})=>!o.includes("\u52FE\u9009\u5217")},{prop:"username",label:"\u8D26\u53F7",minWidth:"140px"},{prop:"status",label:"\u72B6\u6001",minWidth:"90px",...J(x)},{prop:"name",label:"\u5BA2\u6237\u59D3\u540D",minWidth:"100px"},{prop:"mobile",label:"\u5BA2\u6237\u624B\u673A\u53F7",minWidth:"110"},{prop:"time",minWidth:"310",label:"\u8D26\u6237\u6709\u6548\u671F",...X(["starttime","expiretime"],"~")},{prop:"activetime",label:"\u8D26\u6237\u6FC0\u6D3B\u65F6\u95F4",width:"180px"},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",minWidth:"160px"},{label:"\u64CD\u4F5C",fixed:"right",width:120,slot:"operation"}],fe={title:"\u7528\u6237\u7BA1\u7406",columns:me,apis:{httpList:de,httpUpdate:ce},notPreview:!1},Fe=fe,he={title:"\u8D26\u53F7",colLayout:{span:12},itemStyle:{},contact:"invoice_mobile",formItems:[{field:"username",type:"input",label:"\u8D26\u53F7",placeholder:"\u8D26\u53F7"},{field:"company_title",type:"input",label:"\u516C\u53F8",placeholder:"\u516C\u53F8"},{field:"card_title",type:"input",label:"\u5361\u7C7B\u578B",placeholder:"\u5361\u7C7B\u578B"},{field:"name",type:"input",label:"\u5BA2\u6237\u59D3\u540D",placeholder:"\u5BA2\u6237\u59D3\u540D"},{field:"mobile",type:"input",label:"\u624B\u673A\u53F7",placeholder:"\u624B\u673A\u53F7"},{field:"addtime",type:"input",label:"\u521B\u5EFA\u65F6\u95F4",placeholder:"\u521B\u5EFA\u65F6\u95F4"},{field:"video_list",type:"array",label:"\u76F4\u64AD\u89C6\u9891",slot:"video_list",placeholder:"\u76F4\u64AD\u89C6\u9891",span:24},{field:"remark",type:"input",label:"\u5907\u6CE8",placeholder:"\u5907\u6CE8",span:24}]},_e=he,w={labelWidth:"85px",formItems:[{label:"\u8D26\u6237id",field:"id",type:"input",isHidden:!0,placeholder:"\u8D26\u6237id",span:24},{label:"\u8D26\u6237",field:"username",slot:"username",placeholder:"\u8D26\u6237",span:12},{label:"\u6DFB\u52A0\u65F6\u95F4",field:"addtime",slot:"addtime",placeholder:"\u6DFB\u52A0\u65F6\u95F4",span:12},{label:"\u516C\u53F8",field:"company_title",slot:"company_title",placeholder:"\u516C\u53F8",span:12},{label:"\u5361\u7C7B\u578B",field:"card_title",slot:"card_title",placeholder:"\u5361\u7C7B\u578B",span:12},{label:"\u6709\u6548\u5F00\u59CB\u65E5\u671F",field:"starttime",type:"date_picker",otherOptions:{type:"date",format:"YYYY-MM-DD"},placeholder:"\u6709\u6548\u5F00\u59CB\u65E5\u671F",span:12},{label:"\u6709\u6548\u7ED3\u675F\u65F6\u95F4",field:"expiretime",type:"date_picker",otherOptions:{type:"date",format:"YYYY-MM-DD"},placeholder:"\u6709\u6548\u7ED3\u675F\u65F6\u95F4",span:12},{label:"\u59D3\u540D",field:"name",type:"input",placeholder:"\u59D3\u540D",span:12},{label:"\u624B\u673A\u53F7",field:"mobile",type:"input",placeholder:"\u624B\u673A\u53F7",span:12},{label:"\u5907\u6CE8",field:"remark",type:"textarea",placeholder:"\u5B57\u6BCD\u6BB5",span:24},{label:"\u76F4\u64AD\u89C6\u9891",field:"video_ids",slot:"video_ids",type:"array",placeholder:"\u76F4\u64AD\u89C6\u9891",span:24}]},Ce={starttime:{trigger:"change",required:!0,validator(o,e){return(e!=null?e:"")===""?new Error("\u8BF7\u9009\u62E9\u6709\u6548\u5F00\u59CB\u65E5\u671F"):!0}},expiretime:{trigger:"change",required:!0,validator(o,e){return(e!=null?e:"")===""?new Error("\u8BF7\u9009\u62E9\u6709\u6548\u7ED3\u675F\u65E5\u671F"):!0}},name:{trigger:"change",required:!0,validator(o,e){return e===""?new Error("\u8BF7\u8F93\u5165\u59D3\u540D\uFF01"):ae(e)?ie(e)?new Error("\u59D3\u540D\u5FC5\u987B\u4E3A\u6C49\u5B57\uFF01"):!0:new Error("\u59D3\u540D\u5FC5\u987B\u4E3A\u6C49\u5B57\uFF01")}},mobile:{trigger:"change",required:!0,validator(o,e){return!e||!oe(e)?new Error("\u624B\u673A\u53F7\u4E0D\u89C4\u8303\uFF01"):!0}},video_ids:{trigger:"change",required:!0,validator(o,e){return le(e)?e.length===0?new Error("\u8BF7\u9009\u62E9\u76F4\u64AD\u89C6\u9891"):!0:new Error("\u8BF7\u9009\u62E9\u76F4\u64AD\u89C6\u9891")}}},Be={style:{width:"100%",padding:"0 0 15px 0"}},De={style:{width:"50%"}},ve={class:"w-full flex justify-end"},Le=W({__name:"index",setup(o){const{formItems:e}=w,u=f(G(e)),{pageContentRef:C,handleResetClick:R,handleSearchClick:S}=K(void 0,void 0,k),{pageModalRef:I,handleUpdateData:M,handlePreviewData:P,handleConfrim:B,defaultInfo:Y}=Q({pageContentRef:C}),$=te(),D=f("");async function v(n,i){const{id:r}=n,{code:s,data:t,message:m}=await pe({id:r});$({code:s,message:m,handler:()=>{i==="preview"&&P(t),i==="update"&&(u.value=ee(e,t,{video_ids:"video_list"}),columnsData=t,M(a(u)))}})}const g=f(null);function q(){g.value.validate(n=>{if(!n)return;const{video_ids:i}=u.value,r=a(u);let s=[];i.forEach(t=>{s.push(t.id)}),r.video_ids=s,B("update",r)})}function O(n){if(n){const{id:i,video_name:r}=n;u.value.video_ids.findIndex(t=>t.id+""==i+"")==-1&&u.value.video_ids.push({id:i,video_name:r})}}return(n,i)=>{const r=y("el-tag"),s=y("ElButton");return F(),b(E,null,[p(a(H),{"form-config":a(k),onSearchBtnClick:a(S),onResetBtnClick:a(R)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),p(a(ue),{ref_key:"pageContentRef",ref:C,"content-config":a(Fe),onPreviewBtnClick:i[0]||(i[0]=t=>v(t,"preview")),onUpdateBtnClick:i[1]||(i[1]=t=>v(t,"update"))},null,8,["content-config"]),p(a(Z),{ref_key:"pageModalRef",ref:I,"modal-config":a(_e),"default-info":a(Y),onConfirmBtnClick:a(B)},{default:l(()=>[p(a(re),L({ref_key:"basicFormRef",ref:g},a(w),{"form-data":u.value,rules:a(Ce),disabled:!1,"label-width":"120px"}),{username:l(()=>[d("div",null,c(u.value.username),1)]),addtime:l(()=>[d("div",null,c(u.value.addtime),1)]),company_title:l(()=>[d("div",null,c(u.value.company_title),1)]),card_title:l(()=>[d("div",null,c(u.value.card_title),1)]),video_ids:l(()=>[N(d("div",Be,[(F(!0),b(E,null,U(u.value.video_ids,(t,m)=>(F(),j(r,{key:t.id+m,class:"mx-1","disable-transitions":"",closable:"",size:"large",onClose:ge=>u.value.video_ids.splice(m,1)},{default:l(()=>[A(c(t.video_name),1)]),_:2},1032,["onClose"]))),128))],512),[[T,u.value.video_ids&&u.value.video_ids.length>0]]),d("div",De,[p(a(ne),{modelValue:D.value,"onUpdate:modelValue":i[2]||(i[2]=t=>D.value=t),placeholder:"\u8BF7\u9009\u62E9\u76F4\u64AD\u89C6\u9891",onChange:O},null,8,["modelValue"])])]),footer:l(()=>[d("div",ve,[p(s,{type:"primary",onClick:q},{default:l(()=>[A("\u4FDD\u5B58")]),_:1})])]),_:1},16,["form-data","rules"])]),_:1},8,["modal-config","default-info","onConfirmBtnClick"])],64)}}});export{Le as default};
|