index.0ab3fbf9.js 6.7 KB

1
  1. import{B as O,_ as T,P as U}from"./page-content.e0c7af12.js";import{u as V}from"./use-page-search.0f272301.js";import{S as w}from"./status.2b37e8be.js";import{c as x,r as j}from"./column-helper.64ceba17.js";import{ak as _,al as N,a as R,b as A,c as m,j as v,h as B,e as $,i as M,x as q,p as G,F as L,r as C,I as D,w as W,u as e,aq as X,l as I,m as Y,P as z,f as y}from"./index.4d061c66.js";import{h as H}from"./company.479d8ad0.js";import{h as J}from"./card.7fa38337.js";import"./remote-select.36ee67a3.js";import"./useAsync.df7387ce.js";import"./useNav.5e73c372.js";import"./image.e35d846c.js";import"./hooks.9f8f44e2.js";/* empty css */import"./image.4c97dbe3.js";/* empty css */import"./index.e63aea62.js";import"./responseHandle.fe68d5aa.js";const K={formItems:[{field:"status",type:"select",placeholder:"\u72B6\u6001",options:x(w)},{field:"title",type:"input",placeholder:"\u4F01\u4E1A\u540D\u79F0"},{field:"contacts",type:"input",placeholder:"\u8054\u7CFB\u4EBA"},{field:"mobile",type:"input",placeholder:"\u8054\u7CFB\u65B9\u5F0F"}]},S=K,{VITE_PROXY_DOMAIN_REAL:b}=N();async function Q(o={}){return _.request("post",`${b}admin/companyAdd`,{data:o})}async function Z(o={}){return _.request("post",`${b}admin/companylist`,{data:o})}async function ee(o={}){return _.request("post",`${b}admin/companyEdit`,{data:o})}async function te(o={}){return _.request("post",`${b}admin/companyChange`,{data:o})}async function oe(o={}){return _.request("post",`${b}admin/companyDelete`,{data:o})}const ne=[{type:"selection",width:55,hide:({checkList:o})=>!o.includes("\u52FE\u9009\u5217")},{prop:"id",label:"ID"},{prop:"title",label:"\u5361\u7C7B\u578B"},{prop:"status",label:"\u72B6\u6001",...j(w)},{prop:"contacts",label:"\u8054\u7CFB\u4EBA"},{prop:"mobile",label:"\u8054\u7CFB\u65B9\u5F0F"},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",sortable:!0},{label:"\u64CD\u4F5C",fixed:"right",width:160,slot:"operation"}],ae={title:"\u5546\u54C1\u7BA1\u7406",columns:ne,apis:{httpAdd:Q,httpList:Z,httpUpdate:ee,httpStatus:te,httpDelete:oe}},le=ae,ie={title:"\u4F01\u4E1A\u5546\u54C1",colLayout:{span:24},itemStyle:{},contact:"setUserVideo",labelWidth:"85px",formItems:[{field:"name",type:"remote-select",label:"\u4E1A\u52A1\u4F01\u4E1A",placeholder:"\u4E1A\u52A1\u4F01\u4E1A",otherOptions:{api:H,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:J,responseLabelProp:"title",responseValPro:"id",requesetProp:"",isRoot:!1,prop:"list"},span:24,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5361\u7C7B\u578B"}]}]},re=ie,ue={modalConfig:{type:Object,required:!0},prviewDescription:{type:Boolean,default:!1},defaultInfo:{type:Object,required:!0}},se={config:{type:Object,required:!0},defaultInfo:{type:Object,required:!0}},de=R({__name:"description",props:se,setup(o){return(d,g)=>{const u=A("el-descriptions-item"),r=A("el-descriptions");return m(),v(r,{column:1,border:""},{default:B(()=>[(m(!0),$(L,null,M(d.config.formItems,(t,s)=>(m(),v(u,{key:s,label:t.label,align:"center"},{default:B(()=>[q(G(d.defaultInfo[t.field]),1)]),_:2},1032,["label"]))),128))]),_:1})}}}),pe={update:"\u7F16\u8F91",create:"\u65B0\u589E",preview:"\u8BE6\u60C5"};function ce(o){return pe[o]}const fe={key:2,class:"flex justify-end"},me=R({__name:"page-modal",props:ue,emits:["confirmBtnClick"],setup(o,{expose:d,emit:g}){const u=o,r=C({}),t=C("preview"),s=C(null),c=C(!1),h=C(!1),f=D(()=>t.value==="preview"),k=D(()=>{const l=ce(t.value);return t.value==="preview"?u.modalConfig.title+l:l+u.modalConfig.title}),i=D(()=>u.modalConfig.width);function p(l,n){for(const a of l)switch(a.type){case"checkbox":r.value[a.field]=n[a.field]?n[a.field].split(","):[];break;case"img_upload_list":r.value[a.field]=n[a.field]?n[a.field]:[];break;case"number":r.value[a.field]=n[a.field]?n[a.field]:0;break;default:r.value[a.field]=n[a.field]?n[a.field]:"";break}}W(()=>u.defaultInfo,l=>{const{formGroup:n,formItems:a}=u.modalConfig;if(!n)return p(a,l);n.forEach(P=>p(P.formItems,l))});function F(){s.value.validate(l=>{l&&g("confirmBtnClick",e(t),e(r))})}return d({dialogVisible:c,confirmLoading:h,type:t}),(l,n)=>{const a=A("el-button"),P=A("el-dialog");return m(),v(P,{title:e(k),modelValue:c.value,"onUpdate:modelValue":n[2]||(n[2]=E=>c.value=E),"close-on-press-escape":!1,center:"","append-to-body":"","destroy-on-close":"",width:e(i)?e(i):"1024px"},{default:B(()=>[e(f)?I("",!0):(m(),v(e(O),X({key:0,ref_key:"formRef",ref:s},l.modalConfig,{"form-data":r.value,"onUpdate:form-data":n[0]||(n[0]=E=>r.value=E),disabled:e(f)}),null,16,["form-data","disabled"])),e(f)?(m(),v(de,{key:1,config:l.modalConfig,"default-info":l.defaultInfo},{default:B(()=>[Y("template",null,[z(l.$slots,"default")])]),_:3},8,["config","default-info"])):I("",!0),e(f)?I("",!0):(m(),$("div",fe,[y(a,{type:"primary",loading:h.value,onClick:F},{default:B(()=>[q("\u4FDD\u5B58")]),_:1},8,["loading"]),y(a,{onClick:n[1]||(n[1]=E=>c.value=!1)},{default:B(()=>[q("\u5173\u95ED")]),_:1})]))]),_:3},8,["title","modelValue","width"])}}});function ge({createCallback:o,updateCallback:d,confirmCallback:g,previewCallback:u,pageContentRef:r}){const t=C(null),s=C({});function c(){s.value={},t.value.type="create",o&&o(),t.value.dialogVisible=!0}function h(i){s.value={...i},t.value.type="update",d&&d(),t.value.dialogVisible=!0}function f(i){s.value={...i},t.value.type="preview",u&&u(),t.value.dialogVisible=!0}function k(i,p){const F=g?g(p):{};t.value.confirmLoading=!0;const l={...i==="update"?{id:s.value.id}:{},...F||{},...p};r.value.onBeforeAction(i,l,()=>{t.value.confirmLoading=!1,t.value.dialogVisible=!1})}return{handleCreateData:c,handleUpdateData:h,handlePreviewData:f,handleConfrim:k,defaultInfo:s,pageModalRef:t}}const Se=R({__name:"index",setup(o){const{pageContentRef:d,handleResetClick:g,handleSearchClick:u}=V(void 0,void 0,S),{pageModalRef:r,handleUpdateData:t,handleCreateData:s,handlePreviewData:c,handleConfrim:h,defaultInfo:f}=ge({pageContentRef:d});return(k,i)=>(m(),$(L,null,[y(e(T),{"form-config":e(S),onSearchBtnClick:e(u),onResetBtnClick:e(g)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),y(e(U),{ref_key:"pageContentRef",ref:d,"content-config":e(le),onCreateBtnClick:e(s),onPreviewBtnClick:i[0]||(i[0]=p=>e(c)(p)),onUpdateBtnClick:i[1]||(i[1]=p=>e(t)(p))},null,8,["content-config","onCreateBtnClick"]),y(e(me),{ref_key:"pageModalRef",ref:r,"modal-config":e(re),"default-info":e(f),onConfirmBtnClick:e(h)},null,8,["modal-config","default-info","onConfirmBtnClick"])],64))}});export{Se as default};