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

2 lines
4.8 KiB
JavaScript

var F=Object.defineProperty;var p=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var d=(o,t,e)=>t in o?F(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,B=(o,t)=>{for(var e in t||(t={}))A.call(t,e)&&d(o,e,t[e]);if(p)for(var e of p(t))E.call(t,e)&&d(o,e,t[e]);return o};var c=(o,t,e)=>new Promise((u,r)=>{var s=a=>{try{l(e.next(a))}catch(i){r(i)}},n=a=>{try{l(e.throw(a))}catch(i){r(i)}},l=a=>a.done?u(a.value):Promise.resolve(a.value).then(s,n);l((e=e.apply(o,t)).next())});import{B as T,u as D}from"./useTable.c9693c1f.js";import{T as w}from"./BasicForm.125f1f29.js";import{bT as I,e4 as y,J as k,aA as b,o as f,h,p as v,x as S,l as R,cs as x,f4 as M,f5 as P}from"./index.3f119c6b.js";import{T as Y}from"./index.b1ee6e2e.js";import"./index.d2253295.js";import"./Checkbox.a0b8db42.js";import"./index.e44f57ca.js";import"./useForm.60adaf13.js";import"./index.46c0faf5.js";import"./index.4437d8fe.js";import"./index.70c65720.js";import"./useSize.f45c96ad.js";import"./eagerComputed.1acb4b4e.js";import"./onMountedOrActivated.fb1068f1.js";import"./useWindowSizeFn.6cbab4af.js";import"./useContentViewHeight.e99b409b.js";import"./ArrowLeftOutlined.1aa78c52.js";import"./transButton.196eaefc.js";import"./index.83364c66.js";import"./index.b67a5789.js";import"./index.e8c8a682.js";import"./dateUtil.64883c7a.js";import"./_baseMerge.983ba197.js";import"./_isIterateeCall.b8bbad05.js";import"./_baseEach.7c3bb20a.js";import"./get.53661100.js";import"./index.b05b66e2.js";import"./FullscreenOutlined.595eb1f5.js";import"./index.729da95d.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.310466e3.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.5feff35f.js";import"./scrollTo.80dc8fd1.js";import"./index.0b5125f7.js";import"./index.95e387ec.js";import"./index.733eb113.js";import"./_baseIteratee.85694b49.js";import"./index.f837075b.js";import"./useRefs.7b6361e7.js";import"./download.794dc9b0.js";import"./index.f19a2075.js";import"./uniqBy.35e163d1.js";const m={xs:24,sm:12,md:8,lg:6,xl:6,xxl:4},_=[{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}],g=[{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}],C=[{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:"ID",dataIndex:"id"},{title:"\u57FA\u5730",dataIndex:"base_name"},{title:"\u76D1\u63A7\u70B9",dataIndex:"point_name"},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"device_type",customRender:({text:o})=>{var e;const t=_.find(({value:u})=>u==o);return(e=t==null?void 0:t.label)!=null?e:o}},{title:"\u5185\u5BB9",dataIndex:"content"},{title:"\u7B49\u7EA7",dataIndex:"lv",width:100,customRender:({text:o})=>{var e;const t=g.find(({value:u})=>u==o);return(e=t==null?void 0:t.label)!=null?e:o}},{title:"\u72B6\u6001",dataIndex:"status",width:100,customRender:({record:o})=>{var n,l;const t=o.status,u=C.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 I(Y,{color:r},()=>s)}},{title:"\u5F00\u59CB\u65F6\u95F4",dataIndex:"created_at",width:180,customRender:({text:o})=>o?y.unix(o).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:g},colProps:m},{field:"device",label:"\u8BBE\u5907\u7C7B\u578B",component:"Select",componentProps:{options:_},colProps:m},{field:"status",label:"\u72B6\u6001",component:"Select",componentProps:{options:C},colProps:m}],H={components:{BasicTable:T,TableAction:w},setup(){const[o,{reload:t}]=D({title:"\u8D26\u53F7\u5217\u8868",api:r=>c(this,null,function*(){const{data:s,meta:n}=yield P(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 M(r.id),x.success("\u6807\u8BB0\u6210\u529F"),t()}),registerTable:o,handleSuccess:()=>{x.success("\u64CD\u4F5C\u6210\u529F"),t()}}}},L={key:0,class:"flex items-center justify-center"};function N(o,t,e,u,r,s){const n=b("TableAction"),l=b("BasicTable");return f(),h("div",null,[v(l,{onRegister:u.registerTable},{bodyCell:S(({column:a,record:i})=>[a.key==="action"?(f(),h("div",L,[v(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"])])):R("",!0)]),_:1},8,["onRegister"])])}var St=k(H,[["render",N]]);export{St as default};