2025-06-30 09:38:03 +08:00

2 lines
6.9 KiB
JavaScript

var V=Object.defineProperty,O=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var x=(o,t,e)=>t in o?V(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,T=(o,t)=>{for(var e in t||(t={}))q.call(t,e)&&x(o,e,t[e]);if(P)for(var e of P(t))$.call(t,e)&&x(o,e,t[e]);return o},R=(o,t)=>O(o,j(t));var y=(o,t,e)=>new Promise((p,c)=>{var F=n=>{try{i(e.next(n))}catch(l){c(l)}},f=n=>{try{i(e.throw(n))}catch(l){c(l)}},i=n=>n.done?p(n.value):Promise.resolve(n.value).then(F,f);i((e=e.apply(o,t)).next())});import{b as N,f as L,c as C,a,h as E,i as w,j as h,k as d,aj as J,p as Y,aa as G,b0 as _,ac as U,q as W,m as D,l as H,bS as z,t as K,al as I}from"./index.f451ea46.js";import{u as Q,a as X,B as Z,c as ee,m as te,n as ue,o as ae,p as oe,e as v,f as ne,q as se,l as le,P as re,h as de,T as ie,g as ce,_ as me,r as pe}from"./header.92f6bcbe.js";import"./user.bf6a5ac8.js";const Fe=N({__name:"Form",emits:["register","reload"],setup(o,{emit:t}){const e=L({dataForm:{id:""}}),{createMessage:p}=Y(),c=C(()=>e.dataForm.id?[]:[{required:!0,trigger:"blur",message:"\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A"}]),F=C(()=>[{field:"account",label:"\u8D26\u53F7",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7",disabled:!0},rules:a(c)},{field:"realName",label:"\u59D3\u540D",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},rules:[{required:!0,trigger:"blur",message:"\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"mobilePhone",label:"\u624B\u673A\u53F7\u7801",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801"},rules:[{required:!0,trigger:"blur",message:"\u624B\u673A\u53F7\u7801\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^1[3456789]\d{9}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",trigger:"blur"}]},{field:"gender",label:"\u6027\u522B",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u6027\u522B",options:[{fullName:"\u4FDD\u5BC6",id:0},{fullName:"\u7537",id:1},{fullName:"\u5973",id:2}]},rules:[{required:!0,trigger:"blur",message:"\u8BF7\u9009\u62E9\u6027\u522B",type:"number"}]},{field:"sortCode",label:"\u6392\u5E8F",defaultValue:0,component:"InputNumber",componentProps:{min:0,max:999999}},{field:"enabledMark",label:"\u72B6\u6001",component:"Switch",defaultValue:1},{field:"description",label:"\u8BF4\u660E",component:"Textarea",componentProps:{rows:3,placeholder:"\u8BF7\u8F93\u5165\u8BF4\u660E"},colProps:{sm:24,span:24}}]),[f,{setFieldsValue:i,resetFields:n,validate:l,updateSchema:M}]=Q({labelWidth:80}),[B,{changeLoading:b,closeModal:k,changeOkLoading:g}]=X(m),u=C(()=>e.dataForm.id?"\u7F16\u8F91":"\u65B0\u5EFA");function m(s){n(),e.dataForm.id=s.id||"",e.dataForm.id&&(b(!0),te(e.dataForm.id).then(r=>{b(!1),e.dataForm=JSON.parse(JSON.stringify(r.data)),i(e.dataForm)})),M([{field:"account",componentProps:{disabled:!!e.dataForm.id}}])}function A(){return y(this,null,function*(){const s=yield l();if(!s)return;g(!0);const r=R(T({},s),{id:e.dataForm.id});(e.dataForm.id?ue:ae)(r).then(S=>{p.success(S.msg),g(!1),k(),t("reload")}).catch(()=>{g(!1)})})}return(s,r)=>(E(),w(a(ee),J(s.$attrs,{onRegister:a(B),width:"600px",title:u.value,onOk:A}),{default:h(()=>[d(a(Z),{onRegister:a(f),schemas:F.value},null,8,["onRegister","schemas"])]),_:1},16,["onRegister","title"]))}});const fe={class:"app-main app-main-count-manage"},ge={class:"jnpf-layout-content"},he={class:"jnpf-content-wrapper"},Be={class:"jnpf-content-wrapper-center"},be={class:"jnpf-content-wrapper-content"},_e=N({__name:"index",setup(o){const{createMessage:t}=Y(),e=oe(),[p,{openModal:c}]=v(),[F,{openModal:f}]=v(),i=[{title:"\u8D26\u53F7",dataIndex:"account",width:200},{title:"\u59D3\u540D",dataIndex:"realName",width:200},{title:"\u624B\u673A\u53F7\u7801",dataIndex:"mobilePhone",width:200},{title:"\u6027\u522B",dataIndex:"gender",width:100,customRender:({record:u})=>u.gender==1?"\u7537":u.gender==2?"\u5973":"\u4FDD\u5BC6"},{title:"\u8BF4\u660E",dataIndex:"description",width:250},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"creatorTime",width:150,format:"date|YYYY-MM-DD HH:mm:ss"},{title:"\u6700\u540E\u4FEE\u6539\u65F6\u95F4",dataIndex:"lastModifyTime",width:150,format:"date|YYYY-MM-DD HH:mm:ss"},{title:"\u6392\u5E8F",dataIndex:"sortCode",width:70,align:"center"},{title:"\u72B6\u6001",dataIndex:"enabledMark",width:70,align:"center"}],[n,{reload:l}]=ne({api:se,columns:i,useSearchForm:!0,formConfig:{schemas:[{field:"keyword",label:"\u5173\u952E\u8BCD",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u67E5\u8BE2",submitOnPressEnter:!0}},{field:"gender",label:"\u6027\u522B",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u6027\u522B",options:[{fullName:"\u4FDD\u5BC6",id:0},{fullName:"\u7537",id:1},{fullName:"\u5973",id:2}]}},{field:"enabledMark",label:"\u72B6\u6001",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",options:[{fullName:"\u542F\u7528",id:1},{fullName:"\u7981\u7528",id:0}]}},{field:"pickerVal",label:"\u521B\u5EFA\u65F6\u95F4",component:"DateRange",componentProps:{format:"YYYY-MM-DD HH:mm:ss",showTime:{defaultValue:[_("00:00:00","HH:mm:ss"),_("23:59:59","HH:mm:ss")]},placeholder:["\u5F00\u59CB\u65F6\u95F4","\u7ED3\u675F\u65F6\u95F4"]}},{field:"pickerVal1",label:"\u6700\u540E\u4FEE\u6539\u65F6\u95F4",component:"DateRange",componentProps:{format:"YYYY-MM-DD HH:mm:ss",showTime:{defaultValue:[_("00:00:00","HH:mm:ss"),_("23:59:59","HH:mm:ss")]},placeholder:["\u5F00\u59CB\u65F6\u95F4","\u7ED3\u675F\u65F6\u95F4"]}}],fieldMapToTime:[["pickerVal",["startTime","endTime"]],["pickerVal1",["lastModifyStartTime","lastModifyEndTime"]]]},actionColumn:{width:150,title:"\u64CD\u4F5C",dataIndex:"action"}});function M(u){return[{label:"\u7F16\u8F91",onClick:B.bind(null,u.id)},{label:"\u5220\u9664",color:"error",modelConfirm:{onOk:b.bind(null,u.id)}},{label:"\u91CD\u7F6E\u5BC6\u7801",onClick:k.bind(null,u.id)}]}function B(u=""){c(!0,{id:u})}function b(u){pe(u).then(m=>{t.success(m.msg),l()})}function k(u){f(!0,{id:u})}function g(){e("/tenant")}return(u,m)=>{const A=U("a-button");return E(),W("div",fe,[d(le),D("div",ge,[D("div",he,[D("div",Be,[D("div",be,[d(re,{title:"\u8D26\u53F7\u7BA1\u7406",onClose:g}),d(a(ce),{onRegister:a(n)},{tableTitle:h(()=>[d(A,{type:"primary",onClick:m[0]||(m[0]=s=>B())},{default:h(()=>[d(a(de)),H("\u65B0\u5EFA ")]),_:1})]),bodyCell:h(({column:s,record:r})=>[s.key==="enabledMark"?(E(),w(a(z),{key:0,color:r.enabledMark==1?"success":"error"},{default:h(()=>[H(K(r.enabledMark==1?"\u542F\u7528":"\u7981\u7528"),1)]),_:2},1032,["color"])):I("",!0),s.key==="action"?(E(),w(a(ie),{key:1,actions:M(r)},null,8,["actions"])):I("",!0)]),_:1},8,["onRegister"])])])]),d(Fe,{onRegister:a(p),onReload:a(l)},null,8,["onRegister","onReload"]),d(me,{onRegister:a(F),onReload:a(l)},null,8,["onRegister","onReload"])])])}}});var Ce=G(_e,[["__scopeId","data-v-5d58c8ca"]]);export{Ce as default};