lcny-vue3-antd-admin/dist/assets/index.e359345d.js

2 lines
3.9 KiB
JavaScript

var _=Object.defineProperty;var m=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var p=(e,t,o)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,d=(e,t)=>{for(var o in t||(t={}))F.call(t,o)&&p(e,o,t[o]);if(m)for(var o of m(t))T.call(t,o)&&p(e,o,t[o]);return e};var c=(e,t,o)=>new Promise((r,i)=>{var u=a=>{try{n(o.next(a))}catch(l){i(l)}},s=a=>{try{n(o.throw(a))}catch(l){i(l)}},n=a=>a.done?r(a.value):Promise.resolve(a.value).then(u,s);n((o=o.apply(e,t)).next())});import{B as C,u as w}from"./useTable.f741abd2.js";import{T as v}from"./BasicForm.a09cb266.js";import{bT as k,e3 as D,J as y,aA as f,o as h,h as b,p as x,x as I,l as A,cs as g,f3 as S,f4 as M}from"./index.663cd213.js";import{T as R}from"./index.34636d44.js";import"./index.2b5538b0.js";import"./Checkbox.43e07ffd.js";import"./index.8649192a.js";import"./useForm.be3592cf.js";import"./index.ae631948.js";import"./index.1162f938.js";import"./index.8d5c82b8.js";import"./useSize.98a4fffc.js";import"./eagerComputed.853ab43a.js";import"./onMountedOrActivated.df36ded3.js";import"./useWindowSizeFn.5778f1f8.js";import"./useContentViewHeight.29aa0bb4.js";import"./ArrowLeftOutlined.f9252e7d.js";import"./transButton.3bf1bab4.js";import"./index.a334b74a.js";import"./index.cb94bfbb.js";import"./index.bfe02408.js";import"./dateUtil.7a8707b0.js";import"./_baseMerge.676d1411.js";import"./_isIterateeCall.251aefc0.js";import"./_baseEach.e87ad5ad.js";import"./get.147fcf35.js";import"./index.3d512a19.js";import"./FullscreenOutlined.fef9b7f1.js";import"./index.1545ccb5.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.12b742a8.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.24a4550d.js";import"./scrollTo.4b885aad.js";import"./index.41ced49a.js";import"./index.c61b6527.js";import"./index.c88d81b3.js";import"./_baseIteratee.5010dfca.js";import"./index.6781e047.js";import"./useRefs.84e5533f.js";import"./download.260f7d46.js";import"./index.7b6bd88d.js";import"./uniqBy.7d3b7c5e.js";const Y={xs:24,sm:12,md:8,lg:6,xl:6,xxl:4},B=[{value:0,color:"red",label:"\u672A\u5904\u7406"},{value:1,color:"green",label:"\u5DF2\u5904\u7406"},{value:2,color:"pink",label:"\u5DF2\u5FFD\u7565"}],E=[{title:"ID",dataIndex:"id"},{title:"\u5185\u5BB9",dataIndex:"content"},{title:"\u7B49\u7EA7",dataIndex:"lv",width:100},{title:"\u72B6\u6001",dataIndex:"status",width:100,customRender:({record:e})=>{var s,n;const t=e.status,r=B.find(a=>a.value===t),i=(s=r==null?void 0:r.color)!=null?s:"red",u=(n=r==null?void 0:r.label)!=null?n:t;return k(R,{color:i},()=>u)}},{title:"\u5F00\u59CB\u65F6\u95F4",dataIndex:"created_at",width:180,customRender:({text:e})=>e?D.unix(e).format("YYYY-MM-DD HH:mm:ss"):""},{width:90,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],W=[{field:"status",label:"\u72B6\u6001",component:"Select",componentProps:{options:B},colProps:Y}],j={components:{BasicTable:C,TableAction:v},setup(){const[e,{reload:t}]=w({title:"\u8D26\u53F7\u5217\u8868",api:i=>c(this,null,function*(){const{data:u,meta:s}=yield M(d({},i));return{items:u,total:s==null?void 0:s.total}}),rowKey:"id",columns:E,formConfig:{labelWidth:80,schemas:W},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0});return{handleMark:i=>c(this,null,function*(){yield S(i.id),g.success("\u5220\u9664\u6210\u529F"),t()}),registerTable:e,handleSuccess:()=>{g.success("\u64CD\u4F5C\u6210\u529F"),t()}}}},H={key:0,class:"flex items-center justify-center"};function L(e,t,o,r,i,u){const s=f("TableAction"),n=f("BasicTable");return h(),b("div",null,[x(n,{onRegister:r.registerTable},{bodyCell:I(({column:a,record:l})=>[a.key==="action"?(h(),b("div",H,[x(s,{actions:[{label:"\u6807\u8BB0",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u6807\u8BB0",placement:"topRight",confirm:r.handleMark.bind(null,l)},ifShow:l.status==0}]},null,8,["actions"])])):A("",!0)]),_:1},8,["onRegister"])])}var At=y(j,[["render",L]]);export{At as default};