index.150f2424.js 5.7 KB

1
  1. import{_ as w}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 C,aK as v,bt as R,b as Y,p as f,k as M,o as P,c as I,j as r,f as e,A as o,aM as V,a as d,l as q,F as S,aN as B}from"./index.4d3e3847.js";import{r as $,t as F}from"./column-helper.adef10ea.js";import{u as N,c as j,_ as O}from"./use-page-modal.6d6e7705.js";import{P as U}from"./page-content.1fdb6363.js";import"./basic-form.vue_vue_type_style_index_0_scoped_d6f0d2ed_lang.3165143d.js";import{_ as L,a as T}from"./Card.vue_vue_type_script_setup_true_lang.d0a041b7.js";import{v as W,f as J}from"./validate.93ab4ac7.js";import{B as H}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"./image.7849d972.js";const K={formItems:[{field:"title",type:"input",placeholder:"\u4F01\u4E1A\u540D\u79F0"},{field:"company_title",type:"input",placeholder:"\u4F01\u4E1A\u540D\u79F0"},{field:"card_title",type:"input",placeholder:"\u5361\u7C7B\u578B\u540D\u79F0"}]},h=K,{VITE_PROXY_DOMAIN_REAL:g}=v();async function X(a={}){return C.request("post",`${g}/admin/AccoountBatchAdd`,{data:a})}async function z(a){return C.request("post",`${g}admin/accoountBatchLog`,{data:a})}const G=[{type:"selection",width:55,hide:({checkList:a})=>!a.includes("\u52FE\u9009\u5217")},{prop:"id",label:"ID",width:"90px"},{prop:"status",label:"\u72B6\u6001",...$(R),width:"100px"},{prop:"company_title",label:"\u516C\u53F8\u540D\u79F0",minWidth:"150px"},{prop:"card_title",label:"\u5361\u7C7B\u578B",width:"120px"},{prop:"contacts",label:"\u5B57\u6BCD\u6BB5-\u5E74\u4EFD\u6BB5",...F(["username_prefix","username_year"],"-"),width:"120px"},{prop:"starttime",label:"\u6709\u6548\u65E5\u671F",...F(["starttime","expiretime"],"~"),width:"200px"},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",sortable:!0,width:"160px"},{label:"\u64CD\u4F5C",fixed:"right",width:60,slot:"operation"}],Q={title:"\u6279\u91CF\u521B\u5EFA\u8D26\u53F7",columns:G,apis:{httpAdd:X,httpList:z}},Z=Q,ee={title:"\u6279\u91CF\u521B\u5EFA\u8D26\u53F7",colLayout:{span:24},itemStyle:{},contact:"batchCreatUser",labelWidth:"100px",width:"700px",formItems:[]},te=ee,_={labelWidth:"85px",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:"\u524D\u7F00",field:"headname",slot:"headname",placeholder:"\u524D\u7F00",span:12},{label:"\u5B57\u6BCD\u6BB5",field:"username_prefix",type:"input",placeholder:"\u5B57\u6BCD\u6BB5",span:12},{label:"\u5E74\u4EFD\u6BB5",field:"username_year",type:"number",placeholder:"\u5E74\u4EFD\u6BB5",span:12},{label:"\u6570\u5B57\u6BB5",field:"suffix",slot:"suffix",placeholder:"\u6570\u5B57\u6BB5",span:12},{label:"\u6709\u6548\u65F6\u95F4",field:"time",type:"date_picker",otherOptions:{type:"daterange",startProp:"start",endProp:"end",startPlaceholder:"\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4",format:"YYYY-MM-DD"},placeholder:"\u6709\u6548\u65F6\u95F4",span:24}]},ue={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"},headname:{trigger:"change",required:!1,message:"\u8BF7\u9009\u62E9\u8D26\u53F7\u56FA\u5B9A\u524D\u7F00"},username_prefix:{trigger:"change",required:!0,validator(a,u){return u===""?new Error("\u8BF7\u8F93\u5165\u5B57\u6BCD\u6BB5"):W(u)?!0:new Error("\u5B57\u6BCD\u6BB5\u5FC5\u987B\u4E3A\u5927\u5199\u5B57\u6BCD\uFF01")}},username_year:{trigger:"change",required:!0,validator(a,u){return typeof u!="number"?new Error("\u8BF7\u8F93\u5165\u5E74\u4EFD\u6BB5"):Number(u+"")<0?new Error("\u5E74\u4EFD\u6BB5\u4E0D\u80FD\u4F4E\u4E8E0"):!0}},time:{trigger:"change",required:!0,validator(a,u){return J(u)?u.length===0?new Error("\u8BF7\u9009\u62E9\u6709\u6548\u65F6\u95F4"):!0:new Error("\u8BF7\u9009\u62E9\u6709\u6548\u65F6\u95F4")}}},ae=d("span",null,"CJ1745",-1),re=d("span",null,"0000~9999",-1),oe={class:"w-full flex justify-end"},be=Y({__name:"index",setup(a){const{pageContentRef:u,handleResetClick:i,handleSearchClick:E}=A(void 0,void 0,h),{pageModalRef:D,handleCreateData:y,handleConfrim:c,defaultInfo:b}=N({pageContentRef:u}),{formItems:x}=_,p=f(null),n=f(j(x));function k(){p.value.validate(m=>{if(!m)return;const t=e(n),{time:l}=t;t.starttime=l[0]?B(l[0]).format("YYYY-MM-DD"):"",t.expiretime=l[1]?B(l[1]).format("YYYY-MM-DD"):"",delete t.headname,delete t.suffix,delete t.title,c("create",t)})}return(m,t)=>{const l=M("ElButton");return P(),I(S,null,[r(e(w),{"form-config":e(h),onSearchBtnClick:e(E),onResetBtnClick:e(i)},null,8,["form-config","onSearchBtnClick","onResetBtnClick"]),r(e(U),{ref_key:"pageContentRef",ref:u,"content-config":e(Z),onCreateBtnClick:e(y)},null,8,["content-config","onCreateBtnClick"]),r(e(O),{ref_key:"pageModalRef",ref:D,"modal-config":e(te),"default-info":e(b),onConfirmBtnClick:e(c)},{default:o(()=>[r(e(H),V({ref_key:"basicFormRef",ref:p},e(_),{"form-data":n.value,rules:e(ue),disabled:!1,"label-width":"120px"}),{company_id:o(()=>[r(e(L),{modelValue:n.value.company_id,"onUpdate:modelValue":t[0]||(t[0]=s=>n.value.company_id=s),placeholder:"\u516C\u53F8"},null,8,["modelValue"])]),card_id:o(()=>[r(e(T),{modelValue:n.value.card_id,"onUpdate:modelValue":t[1]||(t[1]=s=>n.value.card_id=s),placeholder:"\u5361\u7C7B\u578B"},null,8,["modelValue"])]),headname:o(()=>[ae]),suffix:o(()=>[re]),footer:o(()=>[d("div",oe,[r(l,{type:"primary",onClick:k},{default:o(()=>[q("\u4FDD\u5B58")]),_:1})])]),_:1},16,["form-data","rules"])]),_:1},8,["modal-config","default-info","onConfirmBtnClick"])],64)}}});export{be as default};