index.42a5bcb1.js 5.5 KB

1
  1. import{_ as Y}from"./page-search.vue_vue_type_script_setup_true_lang.e284bf07.js";import{u as A}from"./use-page-search.da34a19a.js";import{aJ as i,aK as P,aI as S,b as q,p as h,k as I,o as M,c as V,j as n,f as t,A as d,aM as O,a as L,l as N,F as U,aN as c,b4 as j}from"./index.4d3e3847.js";import{r as T}from"./column-helper.adef10ea.js";import{u as W,c as H,_ as J,t as K}from"./use-page-modal.6d6e7705.js";import{h as X}from"./company.a05c4b39.js";import{P as z}from"./page-content.1fdb6363.js";import"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{_ as G,a as Q}from"./Card.vue_vue_type_script_setup_true_lang.d0a041b7.js";import{B as Z}from"./basic-form.114da3ff.js";import{u as ee}from"./useAsync.24db85a6.js";import"./hooks.428ba1c3.js";import"./useNav.afbe69e0.js";import"./validate.93ab4ac7.js";import"./index.a5d44002.js";import"./responseHandle.db1518c7.js";import"./xlsx.ed122d16.js";import"./remoteSelect.9c029262.js";import"./image.7849d972.js";const te={title:"\u670D\u52A1",itemStyle:{},contact:"setService",labelWidth:"100px",formItems:[{field:"company_title",type:"input",label:"\u516C\u53F8",placeholder:"\u516C\u53F8"},{field:"card_title",type:"input",label:"\u5361\u7C7B\u578B",placeholder:"\u5361\u7C7B\u578B"}]},_=te,{VITE_PROXY_DOMAIN_REAL:s}=P();async function ae(a={}){return i.request("post",`${s}admin/groupAdd`,{data:a})}async function oe(a={}){return i.request("post",`${s}admin/groupList`,{data:a})}async function ue(a={}){return i.request("post",`${s}admin/groupRead`,{data:a})}async function ne(a={}){return i.request("post",`${s}admin/groupEdit`,{data:a})}async function re(a={}){return i.request("post",`${s}admin/groupChange`,{data:a})}async function le(a={}){return i.request("post",`${s}admin/groupDelete`,{data:a})}const ie=[{type:"selection",width:55,hide:({checkList:a})=>!a.includes("\u52FE\u9009\u5217")},{prop:"id",label:"ID"},{prop:"company_title",label:"\u516C\u53F8\u540D\u79F0"},{prop:"card_title",label:"\u5361\u7C7B\u578B"},{prop:"status",label:"\u72B6\u6001",...T(S)},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",sortable:!0},{label:"\u64CD\u4F5C",fixed:"right",width:160,slot:"operation"}],se={title:"\u5546\u54C1\u7BA1\u7406",columns:ie,apis:{httpAdd:ae,httpList:oe,httpUpdate:ne,httpStatus:re,httpDelete:le}},de=se,pe={title:"\u4F01\u4E1A\u5546\u54C1",colLayout:{span:24},itemStyle:{},contact:"setComCard",labelWidth:"85px",formItems:[{field:"combination",type:"remote-select",label:"\u516C\u53F8\u5361\u7C7B\u578B",placeholder:"\u516C\u53F8\u5361\u7C7B\u578B",labelWidth:"85px",otherOptions:{api:X,requesetProp:"title",responseLabelProp:"title",responseValPro:"id",prop:"list"},span:24,rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u516C\u53F8\u5361\u7C7B\u578B"}]},{field:"remark",type:"input",labelWidth:"85px",label:"\u5907\u6CE8",placeholder:"\u5907\u6CE8",span:24,rules:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u5907\u6CE8"}]}]},ce=pe,F={formItems:[{label:"\u516C\u53F8",field:"company_id",placeholder:"\u516C\u53F8",span:24,slot:"company_id"},{label:"\u5361\u7C7B\u578B",field:"card_id",placeholder:"\u5361\u7C7B\u578B",span:24,slot:"card_id"},{label:"\u5907\u6CE8",field:"remark",type:"textarea",placeholder:"\u5907\u6CE8",span:24}]},me={company_id:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u516C\u53F8"},card_id:{trigger:"change",required:!0,message:"\u8BF7\u9009\u62E9\u5361\u7C7B\u578B"}},fe={class:"w-full flex justify-end"},Se=q({__name:"index",setup(a){const D=ee(),{pageContentRef:m,handleResetClick:y,handleSearchClick:b}=A(void 0,void 0,_),{pageModalRef:E,handleUpdateData:k,handleCreateData:v,handlePreviewData:x,handleConfrim:f,defaultInfo:R}=W({pageContentRef:m}),{formItems:C}=F,g=h(null),u=h(H(C));function $(){g.value.validate(p=>{if(!p)return;const e=t(u),{starttime:r,endtime:o,expiretime:l}=e;if(e.starttime=r?c(r).format("YYYY-MM-DD"):"",e.endtime=o?c(o).format("YYYY-MM-DD"):"",e.expiretime=l?c(l).format("YYYY-MM-DD"):"",new Date(e.starttime).valueOf()>=new Date(e.endtime).valueOf()){j.warning("\u6D3B\u52A8\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6D3B\u52A8\u7ED3\u675F\u65E5\u671F\uFF01");return}f("create",e)})}async function B(p,e){const{id:r}=p,{code:o,data:l,message:w}=await ue({id:r});D({code:o,message:w,handler:()=>{e==="preview"&&x(l),e==="update"&&(u.value=K(C,l,{}),k(l))}})}return(p,e)=>{const r=I("ElButton");return M(),V(U,null,[n(t(Y),{"form-config":t(_),onSearchBtnClick:t(b),onResetBtnClick:t(y)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),n(t(z),{ref_key:"pageContentRef",ref:m,"content-config":t(de),onCreateBtnClick:t(v),onPreviewBtnClick:e[0]||(e[0]=o=>B(o,"preview")),onUpdateBtnClick:e[1]||(e[1]=o=>B(o,"update"))},null,8,["content-config","onCreateBtnClick"]),n(t(J),{ref_key:"pageModalRef",ref:E,"modal-config":t(ce),"default-info":t(R),onConfirmBtnClick:t(f)},{default:d(()=>[n(t(Z),O({ref_key:"basicFormRef",ref:g},t(F),{"form-data":u.value,rules:t(me),disabled:!1,"label-width":"120px"}),{company_id:d(()=>[n(t(G),{modelValue:u.value.company_id,"onUpdate:modelValue":e[2]||(e[2]=o=>u.value.company_id=o),placeholder:"\u516C\u53F8"},null,8,["modelValue"])]),card_id:d(()=>[n(t(Q),{modelValue:u.value.card_id,"onUpdate:modelValue":e[3]||(e[3]=o=>u.value.card_id=o),placeholder:"\u5361\u7C7B\u578B"},null,8,["modelValue"])]),footer:d(()=>[L("div",fe,[n(r,{type:"primary",onClick:$},{default:d(()=>[N("\u4FDD\u5B58")]),_:1})])]),_:1},16,["form-data","rules"])]),_:1},8,["modal-config","default-info","onConfirmBtnClick"])],64)}}});export{Se as default};