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

2 lines
4.8 KiB
JavaScript

var E=Object.defineProperty;var p=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var d=(e,t,o)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,B=(e,t)=>{for(var o in t||(t={}))T.call(t,o)&&d(e,o,t[o]);if(p)for(var o of p(t))A.call(t,o)&&d(e,o,t[o]);return e};var c=(e,t,o)=>new Promise((u,r)=>{var s=a=>{try{l(o.next(a))}catch(i){r(i)}},n=a=>{try{l(o.throw(a))}catch(i){r(i)}},l=a=>a.done?u(a.value):Promise.resolve(a.value).then(s,n);l((o=o.apply(e,t)).next())});import{B as w,u as D}from"./useTable.0fe7b343.js";import{T as y}from"./useForm.501f3f59.js";import{bV as b,bn as I,cI as k,q as S,aE as f,o as h,h as v,p as _,B as R,l as M,cu as x,fd as P,fe as Y}from"./index.ed5deffd.js";import{T as V}from"./index.afc21ce4.js";import"./index.57e79dcc.js";import"./Checkbox.0ade27c0.js";import"./index.dfe580e1.js";import"./index.271eb465.js";import"./index.0292c9d3.js";import"./index.78c12dec.js";import"./useSize.f4cf68f5.js";import"./eagerComputed.890ab31a.js";import"./onMountedOrActivated.9d9d02f7.js";import"./useWindowSizeFn.a262cec0.js";import"./useContentViewHeight.b8e37cbd.js";import"./ArrowLeftOutlined.9abfd432.js";import"./transButton.f4575a26.js";import"./index.d726974a.js";import"./index.8d83801a.js";import"./index.cf1b1f15.js";import"./dateUtil.91a9b59f.js";import"./_baseMerge.9fac86cf.js";import"./_isIterateeCall.779fe698.js";import"./_baseEach.aed94d5c.js";import"./get.b38b45ae.js";import"./index.5b432cd4.js";import"./FullscreenOutlined.a18420c1.js";import"./index.cca952d1.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.a1f78ebd.js";import"./index.af1b13fa.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.51b9ef19.js";import"./scrollTo.707f46cf.js";import"./index.3b4e2932.js";import"./index.09a74575.js";import"./index.f6ae7164.js";import"./_baseIteratee.7c3a5712.js";import"./index.272fae53.js";import"./useRefs.045d664d.js";import"./download.b80ee91a.js";import"./index.c3b59272.js";import"./uniqBy.6fa12436.js";const m={xs:24,sm:12,md:8,lg:6,xl:6,xxl:4},g=[{label:"\u76D1\u63A7\u8BBE\u5907",value:1},{label:"\u571F\u58E4\u8BBE\u5907",value:2},{label:"\u6C34\u8D28\u8BBE\u5907",value:3},{label:"\u6C14\u8C61\u8BBE\u5907",value:4}],C=[{label:"\u2160\u7EA7\u9884\u8B66",value:1},{label:"\u2161\u7EA7\u9884\u8B66",value:2},{label:"\u2162\u7EA7\u9884\u8B66",value:3},{label:"\u2163\u7EA7\u9884\u8B66",value:4}],F=[{value:0,color:"red",label:"\u672A\u5904\u7406"},{value:1,color:"green",label:"\u5DF2\u5904\u7406"},{value:2,color:"pink",label:"\u5DF2\u5FFD\u7565"}],W=[{title:"\u57FA\u5730",dataIndex:"base_name"},{title:"\u76D1\u63A7\u70B9",dataIndex:"point_name"},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"device_type",customRender:({text:e})=>{var o;const t=g.find(({value:u})=>u==e);return(o=t==null?void 0:t.label)!=null?o:e}},{title:"\u5185\u5BB9",dataIndex:"content",customRender:({text:e})=>b(I,{placement:"bottom",title:e},()=>e)},{title:"\u7B49\u7EA7",dataIndex:"lv",width:100,customRender:({text:e})=>{var o;const t=C.find(({value:u})=>u==e);return(o=t==null?void 0:t.label)!=null?o:e}},{title:"\u72B6\u6001",dataIndex:"status",width:100,customRender:({record:e})=>{var n,l;const t=e.status,u=F.find(a=>a.value===t),r=(n=u==null?void 0:u.color)!=null?n:"red",s=(l=u==null?void 0:u.label)!=null?l:t;return b(V,{color:r},()=>s)}},{title:"\u5F00\u59CB\u65F6\u95F4",dataIndex:"created_at",width:180,customRender:({text:e})=>e?k.unix(e).format("YYYY-MM-DD HH:mm:ss"):""},{width:90,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],j=[{field:"lv",label:"\u7B49\u7EA7",component:"Select",componentProps:{options:C},colProps:m},{field:"device",label:"\u8BBE\u5907\u7C7B\u578B",component:"Select",componentProps:{options:g},colProps:m},{field:"status",label:"\u72B6\u6001",component:"Select",componentProps:{options:F},colProps:m}],H={components:{BasicTable:w,TableAction:y},setup(){const[e,{reload:t}]=D({title:"\u8D26\u53F7\u5217\u8868",api:r=>c(this,null,function*(){const{data:s,meta:n}=yield Y(B({},r));return{items:s,total:n==null?void 0:n.total}}),rowKey:"id",columns:W,formConfig:{labelWidth:80,schemas:j},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0});return{handleMark:r=>c(this,null,function*(){yield P(r.id),x.success("\u6807\u8BB0\u6210\u529F"),t()}),registerTable:e,handleSuccess:()=>{x.success("\u64CD\u4F5C\u6210\u529F"),t()}}}},L={key:0,class:"flex items-center justify-center"};function N(e,t,o,u,r,s){const n=f("TableAction"),l=f("BasicTable");return h(),v("div",null,[_(l,{onRegister:u.registerTable},{bodyCell:R(({column:a,record:i})=>[a.key==="action"?(h(),v("div",L,[_(n,{actions:[{label:"\u6807\u8BB0",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u6807\u8BB0",placement:"topRight",confirm:u.handleMark.bind(null,i)},ifShow:i.status==0}]},null,8,["actions"])])):M("",!0)]),_:1},8,["onRegister"])])}var Rt=S(H,[["render",N]]);export{Rt as default};